backlog 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +18 -12
- data/app/controllers/backlogs_controller.rb +5 -0
- data/app/controllers/tasks_controller.rb +2 -2
- data/app/models/party.rb +1 -1
- data/app/models/task.rb +3 -2
- data/app/models/user.rb +8 -4
- data/app/views/groups/edit.rhtml +2 -1
- data/app/views/layouts/_left_top.rhtml +2 -14
- data/app/views/periods/_form.rhtml +1 -0
- data/app/views/tasks/_form.rhtml +1 -1
- data/app/views/tasks/_task.rhtml +5 -5
- data/config/database.yml +9 -9
- data/config/environments/development.rb +4 -3
- data/config/environments/production.rb +10 -1
- data/config/environments/user_environment.rb +4 -4
- data/lib/url_for_fix.rb +5 -3
- data/test/fixtures/tasks.yml +71 -65
- data/test/fixtures/users.yml +1 -1
- data/test/functional/tasks_controller_test.rb +1 -0
- data/test/functional/user_controller_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/test/unit/user_test.rb +4 -4
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,17 +1,25 @@
|
|
1
|
-
== 0.10.
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
== 0.10.3 2007-09-24
|
2
|
+
|
3
|
+
* Removed "Active Sprint" from Group edit view, when there is no active sprint.
|
4
|
+
* Made "Home" link correct when running in application server with JRuby.
|
5
|
+
* Made notices and messages a bit prettier and easier to read.
|
6
|
+
* Added link to create new group in the "New sprint" view.
|
7
|
+
* Fixed link to party from task edit view. Got broken when reverting from EdgeRails.
|
8
|
+
* Changed default database.yml to work in Aptana RadRails.
|
9
|
+
* Removed Datek specific info from environment files.
|
10
|
+
* Changed to raise mail delivery failures to help user choose valid email address.
|
11
|
+
* Changed expiry of login token from 1 day to 1 year to enable cookie login.
|
12
|
+
* Fixed indentation for subtasks in task lists.
|
13
|
+
* Changed to allow revising estimates for tasks in future sprints.
|
14
|
+
* Fixed bug in ordering of subtasks.
|
15
|
+
* Fixed bug in task ordering in backlog view.
|
16
|
+
|
17
|
+
== 0.10.2 2007-09-23
|
6
18
|
|
7
19
|
* Removed version from name of released WAR file to enable easier replacement in Tomcat.
|
8
20
|
* Fixed bug when starting work on a task.
|
9
21
|
|
10
|
-
== 0.10.1 2007-09-
|
11
|
-
|
12
|
-
=== Features
|
13
|
-
|
14
|
-
=== Fixes
|
22
|
+
== 0.10.1 2007-09-22
|
15
23
|
|
16
24
|
* Fixed bug in "remember me" login when running with JRuby
|
17
25
|
* Fixed bug when moving a task to next sprint on mysql
|
@@ -44,8 +52,6 @@
|
|
44
52
|
|
45
53
|
== 0.9.1 2007-09-09
|
46
54
|
|
47
|
-
=== Fixes
|
48
|
-
|
49
55
|
* Fixed loading of database config in production environment.
|
50
56
|
* Fixed misaligned columns in weekly work sheet when invoicing is disabled.
|
51
57
|
* Added "Back" link from Show Backlog view.
|
@@ -38,6 +38,11 @@ class BacklogsController < ApplicationController
|
|
38
38
|
@completed_tasks = @backlog.tasks.select {|t| t.finished_at}.sort {|t1, t2| t2.finished_at <=> t1.finished_at}
|
39
39
|
end
|
40
40
|
|
41
|
+
def show_no_layout
|
42
|
+
show
|
43
|
+
render :partial => 'tasks'
|
44
|
+
end
|
45
|
+
|
41
46
|
def new
|
42
47
|
@backlog = Backlog.new
|
43
48
|
end
|
@@ -78,7 +78,8 @@ class TasksController < ApplicationController
|
|
78
78
|
if @task.period_id != nil
|
79
79
|
@task.remove_from_list
|
80
80
|
@task.period = nil
|
81
|
-
new_pos = @task.backlog.tasks.count(:conditions => 'period_id IS NULL') + 1
|
81
|
+
new_pos = @task.backlog.tasks.count(:conditions => 'period_id IS NULL AND parent_id IS NULL') + 1
|
82
|
+
params[:task].delete(:period_id)
|
82
83
|
params[:task][:position] = new_pos
|
83
84
|
end
|
84
85
|
end
|
@@ -162,7 +163,6 @@ class TasksController < ApplicationController
|
|
162
163
|
task.period_id = params[:period_id]
|
163
164
|
end
|
164
165
|
task.insert_at params[:position]
|
165
|
-
task.save!
|
166
166
|
back_or_redirect_to :controller => 'periods', :action => :show_no_layout, :id => task.period, :task => task.id
|
167
167
|
end
|
168
168
|
|
data/app/models/party.rb
CHANGED
@@ -17,7 +17,7 @@ class Party < ActiveRecord::Base
|
|
17
17
|
completed_periods = periods.select {|p| p.end_on < Date.today}
|
18
18
|
if last_completed = completed_periods.last
|
19
19
|
last_completed.speed
|
20
|
-
elsif active_period = periods.find {|p| p.active?}
|
20
|
+
elsif active_period = periods.to_ary.find {|p| p.active?}
|
21
21
|
active_period.speed
|
22
22
|
else
|
23
23
|
0
|
data/app/models/task.rb
CHANGED
@@ -15,7 +15,7 @@ class Task < ActiveRecord::Base
|
|
15
15
|
has_many :works, :order => 'completed_at', :dependent => :destroy
|
16
16
|
has_many :task_files, :dependent => :destroy
|
17
17
|
|
18
|
-
acts_as_list :scope => '#{
|
18
|
+
acts_as_list :scope => '#{parent_id ? "parent_id = #{parent_id}" : period_id ? "period_id = #{period_id}" : "period_id IS NULL AND parent_id IS NULL AND backlog_id = #{backlog_id}"} AND finished_at IS NULL'
|
19
19
|
acts_as_tree :order => 'position'
|
20
20
|
|
21
21
|
validates_presence_of :backlog_id, :if => Proc.new { |task| task.parent_id.nil? }
|
@@ -30,8 +30,9 @@ class Task < ActiveRecord::Base
|
|
30
30
|
|
31
31
|
#validates_uniqueness_of :description, :scope => :backlog_id, :if => Proc.new {|task| task.backlog_id && task.previous_task_id.nil?}
|
32
32
|
validates_uniqueness_of :description, :scope => :period_id, :if => :period_id
|
33
|
+
validates_uniqueness_of :position, :scope => :parent_id, :if => :parent_id, :allow_nil => true
|
33
34
|
validates_uniqueness_of :position, :scope => :period_id, :if => :period_id, :allow_nil => true
|
34
|
-
validates_uniqueness_of :position, :scope => [:period_id, :backlog_id], :if => Proc.new {|task| task.period_id.nil?}, :allow_nil => true
|
35
|
+
validates_uniqueness_of :position, :scope => [:period_id, :parent_id, :backlog_id], :if => Proc.new {|task| task.period_id.nil? && task.parent_id.nil?}, :allow_nil => true
|
35
36
|
|
36
37
|
def validate
|
37
38
|
if self.parent_id && (self.period_id || self.backlog_id)
|
data/app/models/user.rb
CHANGED
@@ -68,11 +68,15 @@ class User < Party
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def token_expired?
|
71
|
-
self.security_token
|
71
|
+
self.security_token.nil? or self.token_expiry.nil? or (Clock.now > self.token_expiry)
|
72
|
+
end
|
73
|
+
|
74
|
+
def token_stale?
|
75
|
+
token_expired? or Clock.now.to_i >= (self.token_expiry.to_i - self.class.token_lifetime / 2)
|
72
76
|
end
|
73
77
|
|
74
78
|
def generate_security_token
|
75
|
-
if
|
79
|
+
if token_stale?
|
76
80
|
token = new_security_token
|
77
81
|
return token
|
78
82
|
else
|
@@ -86,7 +90,7 @@ class User < Party
|
|
86
90
|
@password_needs_confirmation = true
|
87
91
|
end
|
88
92
|
|
89
|
-
def token_lifetime
|
93
|
+
def self.token_lifetime
|
90
94
|
UserSystem::CONFIG[:security_token_life_hours] * 60 * 60
|
91
95
|
end
|
92
96
|
|
@@ -119,7 +123,7 @@ class User < Party
|
|
119
123
|
end
|
120
124
|
|
121
125
|
def new_security_token
|
122
|
-
expiry = Time.at(Clock.now.to_i + token_lifetime)
|
126
|
+
expiry = Time.at(Clock.now.to_i + self.class.token_lifetime)
|
123
127
|
write_attribute('security_token', self.class.hashed(self.salted_password + Clock.now.to_i.to_s + rand.to_s))
|
124
128
|
write_attribute('token_expiry', expiry)
|
125
129
|
# update_without_callbacks
|
data/app/views/groups/edit.rhtml
CHANGED
@@ -45,6 +45,7 @@
|
|
45
45
|
|
46
46
|
</div>
|
47
47
|
|
48
|
+
<% if @group.periods.last %>
|
48
49
|
<div id="rfeature">
|
49
50
|
<div class="btitle">
|
50
51
|
<h4><%=l :active %> <%=l :period %></h4>
|
@@ -52,4 +53,4 @@
|
|
52
53
|
|
53
54
|
<%=link_to image_tag(url_for(:controller => 'parties', :action => :burn_down_chart_thumbnail, :format => 'png', :id => @group.id)), :controller => 'parties', :action => :burn_down_chart, :format => :png, :id => @group%>
|
54
55
|
</div>
|
55
|
-
|
56
|
+
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<div id="navbar">
|
2
2
|
<span style="float: left"><%=link_to "#{l :backlog} #{APP::VERSION}", 'http://rubyforge.org/projects/backlog'%></span>
|
3
3
|
<span style="float: left"><form action="<%=url_for :controller => 'search', :action => :results%>"><%=text_field_tag :q, @search || l(:search), :onfocus => "if (value == '#{l(:search)}') value='' "%><%=submit_tag :search, :style => 'display: none'%></form></span>
|
4
|
-
<%= link_to l(:home), '
|
4
|
+
<%= link_to l(:home), url_for(:controller => 'backlogs') %>
|
5
5
|
|
6
6
|
<% if user? %>
|
7
7
|
| <%= link_to l(:backlogs), :controller => 'backlogs', :action => :list %>
|
@@ -13,23 +13,11 @@
|
|
13
13
|
<% if user? %>| <%=link_to user.email, :controller => 'user', :action => :edit%><% end %>
|
14
14
|
</div>
|
15
15
|
<div id="header">
|
16
|
-
<% if flash[:notice] %>
|
16
|
+
<% if flash[:notice] || flash['notice'] || flash[:message] || flash['message'] %>
|
17
17
|
<div id="notice">
|
18
18
|
<%=flash[:notice]%>
|
19
|
-
</div>
|
20
|
-
<% end %>
|
21
|
-
<% if flash['notice'] %>
|
22
|
-
<div id="notice">
|
23
19
|
<%=flash['notice']%>
|
24
|
-
</div>
|
25
|
-
<% end %>
|
26
|
-
<% if flash[:notice] %>
|
27
|
-
<div id="message">
|
28
20
|
<%=flash[:message]%>
|
29
|
-
</div>
|
30
|
-
<% end %>
|
31
|
-
<% if flash['message'] %>
|
32
|
-
<div id="message">
|
33
21
|
<%=flash['message']%>
|
34
22
|
</div>
|
35
23
|
<% end %>
|
@@ -12,6 +12,7 @@
|
|
12
12
|
<% if @period.party %>
|
13
13
|
<%=image_detour_to(@period.party.icon, "#{l(@period.party.to_sym)} #{@period.party.name}", :controller => @period.party.controller, :action => :edit, :id => @period.party) %>
|
14
14
|
<% end %>
|
15
|
+
<%=detour_to l(:new_group), :controller => 'groups', :action => :new %>
|
15
16
|
</p>
|
16
17
|
|
17
18
|
<% if @period.party %>
|
data/app/views/tasks/_form.rhtml
CHANGED
@@ -17,7 +17,7 @@
|
|
17
17
|
<p><label for="task_period_id"><%=l :period%></label><br/>
|
18
18
|
<%= select 'task', 'period_id', [['', '']] + @periods.map{|p| [p.name, p.id]}, {},
|
19
19
|
:onchange => remote_function(:update => 'period_link',
|
20
|
-
:url => { :controller => 'periods', :action => 'make_link', :id => "'+value+'" }) %>
|
20
|
+
:url => { :controller => 'periods', :action => 'make_link', :id => "'+value+'", :escape => false }) %>
|
21
21
|
<span id="period_link">
|
22
22
|
<%=render :partial => '/periods/link', :locals => {:period => @task.period}%>
|
23
23
|
</span>
|
data/app/views/tasks/_task.rhtml
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
<% end %>
|
9
9
|
</td>
|
10
10
|
<td align="left" valign="top" width="1" nowrap="true">
|
11
|
-
<%=detour_to @task.position.to_s, :controller => 'tasks', :action => :edit, :id => @task.id if @task.position || @task.depth == 0 %>
|
12
11
|
<%= (" " * @task.depth * 4) if @task.depth > 0 %>
|
12
|
+
<%=detour_to @task.position.to_s, :controller => 'tasks', :action => :edit, :id => @task.id if @task.position || @task.depth == 0 %>
|
13
13
|
<%= resolution_image(@task.resolution) if @task.finished_at %>
|
14
14
|
<%= "-" if @task.children.size > 0 %>
|
15
15
|
</td>
|
@@ -63,7 +63,7 @@
|
|
63
63
|
<% form_tag({:controller => 'estimates', :action => 'create', :id => @task}) do %>
|
64
64
|
<%= submit_tag('checkmark', :value => l(:save), :style => 'display: none')%>
|
65
65
|
<% if @task.track_todo? %>
|
66
|
-
<% if @task.period.nil? || @task.period.
|
66
|
+
<% if @task.period.nil? || @task.period.active_or_future? %>
|
67
67
|
<%= text_field 'estimate', 'todo', :tabindex => i+2, :id => "#{@task.id}_todo", :value => @task.todo, :class => :task_hours, :maxlength => 4, :onkeypress => "handleEvent(this, event, #{@task.id})" %>
|
68
68
|
<% else %>
|
69
69
|
<%= @task.todo %>
|
@@ -92,8 +92,8 @@
|
|
92
92
|
</tr>
|
93
93
|
|
94
94
|
<% if active && (@task.period.nil? || @task.period.active_or_future?) %>
|
95
|
-
<%=
|
96
|
-
<%=
|
95
|
+
<%=draggable_element "task_#{@task.id}" %>
|
96
|
+
<%=drop_receiving_element "task_#{@task.id}",
|
97
97
|
:update => update, :url => with_detour({:controller => 'tasks', :action => "move_to", :period_id => @task.period_id, :position => @task.position, :layout => false}),
|
98
98
|
:accept => "tasks",
|
99
99
|
:loading => "",
|
@@ -103,6 +103,6 @@
|
|
103
103
|
<% end %>
|
104
104
|
|
105
105
|
<% for subtask in task.children %>
|
106
|
-
<%=render :partial => '/tasks/task', :locals => { :task => subtask, :i => i, :active => active } if (active && subtask.active?) || (!active && subtask.completed?) %>
|
106
|
+
<%=render :partial => '/tasks/task', :locals => { :task => subtask, :i => i, :active => active, :highlight_task => subtask == @selected_task, :update => update } if (active && subtask.active?) || (!active && subtask.completed?) %>
|
107
107
|
<% i += 1 %>
|
108
108
|
<% end %>
|
data/config/database.yml
CHANGED
@@ -1,44 +1,44 @@
|
|
1
1
|
development:
|
2
|
-
|
2
|
+
#<% if RUBY_PLATFORM =~ /java/ %>
|
3
3
|
adapter: jdbc
|
4
4
|
driver: org.postgresql.Driver
|
5
5
|
url: jdbc:postgresql://localhost:5432/backlog_development
|
6
6
|
database: backlog_development
|
7
7
|
username: root
|
8
8
|
host: localhost
|
9
|
-
|
9
|
+
#<% else %>
|
10
10
|
adapter: postgresql
|
11
11
|
database: backlog_development
|
12
12
|
username: root
|
13
13
|
host: localhost
|
14
|
-
|
14
|
+
#<% end %>
|
15
15
|
|
16
16
|
# Warning: The database defined as 'test' will be erased and
|
17
17
|
# re-generated from your development database when you run 'rake'.
|
18
18
|
# Do not set this db to the same as development or production.
|
19
19
|
test:
|
20
|
-
|
20
|
+
#<% if RUBY_PLATFORM =~ /java/ %>
|
21
21
|
adapter: jdbc
|
22
22
|
driver: org.postgresql.Driver
|
23
23
|
url: jdbc:postgresql://localhost:5432/backlog_test
|
24
24
|
database: backlog_test
|
25
25
|
username: root
|
26
26
|
host: localhost
|
27
|
-
|
27
|
+
#<% else %>
|
28
28
|
adapter: postgresql
|
29
29
|
database: backlog_test
|
30
|
-
|
30
|
+
#<% end %>
|
31
31
|
|
32
32
|
production:
|
33
|
-
|
33
|
+
#<% if RUBY_PLATFORM =~ /java/ %>
|
34
34
|
adapter: jdbc
|
35
35
|
driver: org.postgresql.Driver
|
36
36
|
url: jdbc:postgresql://localhost:5432/backlog_production
|
37
37
|
username: root
|
38
38
|
host: localhost
|
39
|
-
|
39
|
+
#<% else %>
|
40
40
|
adapter: postgresql
|
41
41
|
database: backlog_production
|
42
42
|
username: root
|
43
43
|
host: localhost
|
44
|
-
|
44
|
+
#<% end %>
|
@@ -18,9 +18,10 @@ config.action_view.debug_rjs = true
|
|
18
18
|
config.action_mailer.raise_delivery_errors = true
|
19
19
|
|
20
20
|
ActionMailer::Base.delivery_method = :sendmail
|
21
|
+
|
21
22
|
#ActionMailer::Base.delivery_method = :smtp
|
22
|
-
#
|
23
23
|
#ActionMailer::Base.smtp_settings = {
|
24
|
-
# :address => "
|
25
|
-
# :port => 25
|
24
|
+
# :address => "localhost",
|
25
|
+
# :port => 25,
|
26
|
+
# :domain => 'localdomain'
|
26
27
|
#}
|
@@ -15,6 +15,15 @@ config.action_controller.perform_caching = true
|
|
15
15
|
# config.action_controller.asset_host = "http://assets.example.com"
|
16
16
|
|
17
17
|
# Disable delivery errors if you bad email addresses should just be ignored
|
18
|
-
config.action_mailer.raise_delivery_errors =
|
18
|
+
config.action_mailer.raise_delivery_errors = true
|
19
19
|
|
20
|
+
puts "Using sendmail to send mail"
|
20
21
|
ActionMailer::Base.delivery_method = :sendmail
|
22
|
+
|
23
|
+
#puts "Using sendmail to send mail"
|
24
|
+
#ActionMailer::Base.delivery_method = :smtp
|
25
|
+
#ActionMailer::Base.smtp_settings = {
|
26
|
+
# :address => "localhost",
|
27
|
+
# :port => 25,
|
28
|
+
# :domain => 'localdomain'
|
29
|
+
#}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
module UserSystem
|
2
2
|
CONFIG = {
|
3
3
|
# Source address for user emails
|
4
|
-
:email_from => 'backlog@
|
4
|
+
:email_from => 'backlog@backlog.rubyforge.org',
|
5
5
|
|
6
6
|
# Destination email for system errors
|
7
|
-
:admin_email => '
|
7
|
+
:admin_email => 'backlog@backlog.rubyforge.org',
|
8
8
|
|
9
9
|
# Sent in emails to users
|
10
|
-
:app_url => 'http://
|
10
|
+
:app_url => 'http://backlog.rubyforge.org/',
|
11
11
|
|
12
12
|
# Sent in emails to users
|
13
13
|
:app_name => 'Backlog',
|
@@ -16,6 +16,6 @@ module UserSystem
|
|
16
16
|
:mail_charset => 'utf-8',
|
17
17
|
|
18
18
|
# Security token lifetime in hours
|
19
|
-
:security_token_life_hours => 24,
|
19
|
+
:security_token_life_hours => 24 * 365,
|
20
20
|
}
|
21
21
|
end
|
data/lib/url_for_fix.rb
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
module UrlForFix
|
2
2
|
# TODO (uwe): Can be removed when using EdgeRails of Rails >= 1.3
|
3
3
|
def url_for(org_options = {}, *parameters_for_method_reference)
|
4
|
-
return super(org_options, *parameters_for_method_reference) if org_options.is_a?
|
4
|
+
return super(org_options, *parameters_for_method_reference) if org_options.nil? || org_options.is_a?(String)
|
5
5
|
new_options = {}
|
6
6
|
org_options.each do |param, value|
|
7
7
|
add_option(new_options, param, value)
|
8
8
|
end
|
9
|
-
super new_options, *parameters_for_method_reference
|
9
|
+
url = super new_options, *parameters_for_method_reference
|
10
|
+
url = CGI::unescape(url) if url && org_options[:escape] == false
|
11
|
+
url
|
10
12
|
end
|
11
|
-
|
13
|
+
|
12
14
|
# Used with AplicationHelper::url_for
|
13
15
|
def add_option(options, param, value)
|
14
16
|
case value
|
data/test/fixtures/tasks.yml
CHANGED
@@ -1,65 +1,71 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
1
|
+
--- !omap
|
2
|
+
- first:
|
3
|
+
id: 1
|
4
|
+
created_at: 2007-06-11
|
5
|
+
backlog_id: 1
|
6
|
+
period_id: 2
|
7
|
+
description: first task
|
8
|
+
position: 1
|
9
|
+
- another:
|
10
|
+
id: 2
|
11
|
+
created_at: 2007-06-12
|
12
|
+
backlog_id: 1
|
13
|
+
period_id: 3
|
14
|
+
description: second task
|
15
|
+
position: 1
|
16
|
+
- postponed:
|
17
|
+
id: 3
|
18
|
+
created_at: 2007-06-12
|
19
|
+
backlog_id: 1
|
20
|
+
period_id: 3
|
21
|
+
description: postponed task
|
22
|
+
finished_at: 2007-08-02 14:15:42
|
23
|
+
resolution: POSTPONED
|
24
|
+
- started:
|
25
|
+
id: 4
|
26
|
+
created_at: 2007-08-02 14:15:42
|
27
|
+
backlog_id: 2
|
28
|
+
period_id: 3
|
29
|
+
description: third task
|
30
|
+
position: 2
|
31
|
+
- in_last_period:
|
32
|
+
id: 5
|
33
|
+
created_at: 2007-08-02 14:15:42
|
34
|
+
backlog_id: 1
|
35
|
+
period_id: 4
|
36
|
+
description: task in last period
|
37
|
+
initial_estimate: 1.0
|
38
|
+
position: 1
|
39
|
+
previous_task_id: 3
|
40
|
+
- not_planned:
|
41
|
+
id: 6
|
42
|
+
created_at: 2007-08-02 14:15:42
|
43
|
+
backlog_id: 1
|
44
|
+
description: unplanned task
|
45
|
+
position: 1
|
46
|
+
- supertask:
|
47
|
+
id: 7
|
48
|
+
created_at: 2007-06-12
|
49
|
+
backlog_id: 1
|
50
|
+
period_id: 3
|
51
|
+
description: super task
|
52
|
+
position: 3
|
53
|
+
- subtask:
|
54
|
+
id: 8
|
55
|
+
created_at: 2007-06-12
|
56
|
+
parent_id: 7
|
57
|
+
description: sub task
|
58
|
+
position: 1
|
59
|
+
- in_ancient:
|
60
|
+
id: 9
|
61
|
+
created_at: 2007-06-03
|
62
|
+
backlog_id: 1
|
63
|
+
period_id: 1
|
64
|
+
description: ancient task
|
65
|
+
position: 1
|
66
|
+
- subsubtask_2:
|
67
|
+
id: 10
|
68
|
+
created_at: 2007-06-12
|
69
|
+
parent_id: 8
|
70
|
+
description: sub sub task
|
71
|
+
position: 1
|
data/test/fixtures/users.yml
CHANGED
@@ -46,7 +46,7 @@ unverified_user:
|
|
46
46
|
email: unverified_user@example.com
|
47
47
|
verified: false
|
48
48
|
security_token: random_token_string
|
49
|
-
token_expiry: <%= (Clock.now +
|
49
|
+
token_expiry: <%= (Clock.now + User.token_lifetime) %> # for mysql, add .strftime("%y-%m-%d %H:%M:%S")
|
50
50
|
deleted: false
|
51
51
|
|
52
52
|
no_password_user:
|
@@ -109,7 +109,7 @@ class UserControllerTest < Test::Unit::TestCase
|
|
109
109
|
|
110
110
|
def test_welcome__fails_if_expired_token
|
111
111
|
user = users(:unverified_user)
|
112
|
-
Clock.
|
112
|
+
Clock.time = Clock.now + User.token_lifetime + 1 # now past verification deadline
|
113
113
|
get :welcome, :user=> { :id => user.id }, :key => user.security_token
|
114
114
|
user.reload
|
115
115
|
assert !user.verified
|
data/test/test_helper.rb
CHANGED
@@ -46,7 +46,7 @@ class Test::Unit::TestCase
|
|
46
46
|
|
47
47
|
Period.find(:all).each do |p|
|
48
48
|
p.open_tasks.each_with_index do |t, i|
|
49
|
-
assert_equal i+1, t.position
|
49
|
+
assert_equal i+1, t.position, "Open tasks for period #{p.id} are not in sequence:\n#{p.open_tasks.map{|t|[t.id, t.position]}.inspect}\nTask #{t.id} position does not match."
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
data/test/unit/user_test.rb
CHANGED
@@ -17,7 +17,7 @@ class UserTest < Test::Unit::TestCase
|
|
17
17
|
|
18
18
|
def test_authenticate_by_token__fails_if_expired
|
19
19
|
user = users(:unverified_user)
|
20
|
-
Clock.time = Clock.now +
|
20
|
+
Clock.time = Clock.now + User.token_lifetime + 1.days
|
21
21
|
assert_nil User.authenticate_by_token(user.id, user.security_token)
|
22
22
|
end
|
23
23
|
|
@@ -46,18 +46,18 @@ class UserTest < Test::Unit::TestCase
|
|
46
46
|
assert_not_nil token
|
47
47
|
user.reload
|
48
48
|
assert_equal token, user.security_token
|
49
|
-
assert_equal((Clock.now +
|
49
|
+
assert_equal((Clock.now + User.token_lifetime).to_i, user.token_expiry.to_i)
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_generate_security_token__reuses_token_when_not_stale
|
53
53
|
user = users(:unverified_user)
|
54
|
-
Clock.time = Clock.now +
|
54
|
+
Clock.time = Clock.now + User.token_lifetime/2 - 1
|
55
55
|
assert_equal user.security_token, user.generate_security_token
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_generate_security_token__generates_new_token_when_getting_stale
|
59
59
|
user = users(:unverified_user)
|
60
|
-
Clock.time = Clock.now +
|
60
|
+
Clock.time = Clock.now + User.token_lifetime/2
|
61
61
|
assert_not_equal user.security_token, user.generate_security_token
|
62
62
|
end
|
63
63
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: backlog
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.10.
|
7
|
-
date: 2007-09-
|
6
|
+
version: 0.10.3
|
7
|
+
date: 2007-09-24 00:00:00 +02:00
|
8
8
|
summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
|
9
9
|
require_paths:
|
10
10
|
- lib
|