backlog 0.13.0 → 0.13.1
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 +15 -1
- data/Rakefile +2 -0
- data/app/controllers/application.rb +3 -6
- data/app/controllers/backlogs_controller.rb +84 -4
- data/app/controllers/estimates_controller.rb +1 -5
- data/app/controllers/periods_controller.rb +84 -2
- data/app/controllers/tasks_controller.rb +0 -51
- data/app/controllers/works_controller.rb +7 -3
- data/app/helpers/application_helper.rb +9 -0
- data/app/helpers/backlogs_helper.rb +62 -0
- data/app/helpers/periods_helper.rb +63 -0
- data/app/helpers/tasks_helper.rb +0 -72
- data/app/models/period.rb +17 -7
- data/app/models/task.rb +11 -6
- data/app/views/backlogs/_buttons.rhtml +1 -0
- data/app/views/backlogs/_tasks.rhtml +9 -11
- data/app/views/backlogs/finish_task.rjs +3 -0
- data/app/views/backlogs/move_task_to_period.rjs +3 -0
- data/app/views/backlogs/reopen_task.rjs +3 -0
- data/app/views/{tasks/finish.rjs → periods/finish_task.rjs} +0 -0
- data/app/views/{tasks/move_to_period.rjs → periods/move_task_to_period.rjs} +0 -0
- data/app/views/{tasks/reopen.rjs → periods/reopen_task.rjs} +0 -0
- data/app/views/tasks/_completed.rhtml +10 -11
- data/app/views/tasks/_fields_header.rhtml +3 -3
- data/app/views/tasks/_task.rhtml +6 -6
- data/app/views/tasks/update_estimate.rjs +2 -0
- data/app/views/works/_form.rhtml +1 -1
- data/app/views/works/update_time.rjs +1 -1
- data/cruise_config.rb +1 -2
- data/test/functional/periods_controller_test.rb +116 -0
- data/test/functional/tasks_controller_test.rb +0 -116
- data/test/functional/works_controller_test.rb +9 -1
- data/test/performance/test_threaded.rb +38 -18
- metadata +9 -6
- data/app/views/estimates/create_ajax.rjs +0 -11
@@ -206,122 +206,6 @@ class TasksControllerTest < Test::Unit::TestCase
|
|
206
206
|
assert_equal 3, subtask_after.position
|
207
207
|
end
|
208
208
|
|
209
|
-
def test_move_to_next_period
|
210
|
-
before = Task.find(tasks(:another).id)
|
211
|
-
|
212
|
-
post :move_to_next_period, :id => tasks(:another).id
|
213
|
-
|
214
|
-
assert_response :success
|
215
|
-
|
216
|
-
after = Task.find(tasks(:another).id)
|
217
|
-
assert_equal tasks(:another).period_id, after.period_id
|
218
|
-
|
219
|
-
new_task = Task.find_by_period_id_and_previous_task_id(periods(:future).id, before.id)
|
220
|
-
assert_nil new_task.finished_at
|
221
|
-
assert_nil new_task.resolution
|
222
|
-
assert_equal 1, new_task.position
|
223
|
-
end
|
224
|
-
|
225
|
-
def test_move_to_next_period_from_past
|
226
|
-
task = tasks(:first)
|
227
|
-
before = Task.find(task.id)
|
228
|
-
|
229
|
-
post :move_to_next_period, :id => task.id
|
230
|
-
|
231
|
-
assert_response :success
|
232
|
-
|
233
|
-
after = Task.find(task.id)
|
234
|
-
assert_equal task.period_id, after.period_id
|
235
|
-
|
236
|
-
new_task = Task.find_by_period_id_and_previous_task_id(periods(:active).id, task.id)
|
237
|
-
assert_nil new_task.finished_at
|
238
|
-
assert_nil new_task.resolution
|
239
|
-
assert_equal 1, new_task.position
|
240
|
-
end
|
241
|
-
|
242
|
-
def test_move_to_next_period_at_end
|
243
|
-
before = Task.find(tasks(:in_last_period).id)
|
244
|
-
assert_equal tasks(:in_last_period).period_id, before.period_id
|
245
|
-
|
246
|
-
post :move_to_next_period, :id => tasks(:in_last_period).id
|
247
|
-
|
248
|
-
assert_response :success
|
249
|
-
|
250
|
-
before.reload
|
251
|
-
assert_equal tasks(:in_last_period).period_id, before.period_id
|
252
|
-
|
253
|
-
after = Task.find(tasks(:in_last_period).id)
|
254
|
-
assert_equal before.period_id, after.period_id
|
255
|
-
end
|
256
|
-
|
257
|
-
def test_move_to_next_period_from_ancient
|
258
|
-
before = tasks(:in_ancient)
|
259
|
-
previous_last_id = Task.find(:first, :order => 'id DESC').id
|
260
|
-
|
261
|
-
post :move_to_next_period, :id => before.id
|
262
|
-
|
263
|
-
assert_response :success
|
264
|
-
|
265
|
-
after = Task.find(before.id)
|
266
|
-
assert_equal before.period_id, after.period_id
|
267
|
-
assert_equal Task::POSTPONED, after.resolution
|
268
|
-
assert_not_nil after.finished_at
|
269
|
-
|
270
|
-
new = Task.find(:first, :order => 'id DESC', :conditions => "id > #{previous_last_id}")
|
271
|
-
assert_not_nil new
|
272
|
-
assert_equal before.id, new.previous_task_id
|
273
|
-
assert_equal 1, new.position
|
274
|
-
end
|
275
|
-
|
276
|
-
def test_move_to_period
|
277
|
-
highest = Task.find(:first, :order => 'id DESC')
|
278
|
-
|
279
|
-
post :move_to_period, :id => "task_#{tasks(:another).id}",
|
280
|
-
:detour => {:action => 'show_no_layout', :id => periods(:active).id, :controller => 'periods'},
|
281
|
-
:period_id => periods(:future).id
|
282
|
-
|
283
|
-
new_task = Task.find(:first, :order => 'id DESC')
|
284
|
-
assert new_task.id != highest.id
|
285
|
-
assert_equal periods(:future).id, new_task.period_id
|
286
|
-
end
|
287
|
-
|
288
|
-
def test_move_to_period_past
|
289
|
-
post :move_to_period, :id => "task_#{tasks(:another).id}",
|
290
|
-
:detour => {:action => 'show_no_layout', :id => periods(:active).id, :controller => 'periods'},
|
291
|
-
:period_id => periods(:past).id
|
292
|
-
assert_equal periods(:active).id, tasks(:another).period_id
|
293
|
-
end
|
294
|
-
|
295
|
-
def test_move_to_period_back_to_earlier_period
|
296
|
-
task_to_move = tasks(:in_last_period)
|
297
|
-
target_task = tasks(:postponed)
|
298
|
-
target_period = periods(:active)
|
299
|
-
|
300
|
-
post :move_to_period, {"id"=> task_to_move.id,
|
301
|
-
"detour"=>{"action"=>"edit_no_layout", "id"=>"39", "controller"=>"backlogs"},
|
302
|
-
"period_id"=> target_period.id
|
303
|
-
}
|
304
|
-
|
305
|
-
old_task = Task.find(task_to_move.id)
|
306
|
-
assert_not_nil old_task.finished_at
|
307
|
-
assert_equal Task::POSTPONED, old_task.resolution
|
308
|
-
assert_nil old_task.position
|
309
|
-
|
310
|
-
new_task = Task.find(target_task.id)
|
311
|
-
new_task.reload
|
312
|
-
assert_nil new_task.finished_at
|
313
|
-
assert_nil new_task.resolution
|
314
|
-
assert_equal 1, new_task.position
|
315
|
-
end
|
316
|
-
|
317
|
-
def test_abort
|
318
|
-
post :abort, :id => tasks(:first).id
|
319
|
-
|
320
|
-
after = Task.find(tasks(:first).id)
|
321
|
-
assert_not_nil after.finished_at
|
322
|
-
assert_equal Task::ABORTED, after.resolution
|
323
|
-
end
|
324
|
-
|
325
209
|
def test_start_work
|
326
210
|
task_id = tasks(:first).id
|
327
211
|
|
@@ -80,6 +80,14 @@ class WorksControllerTest < Test::Unit::TestCase
|
|
80
80
|
assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:past).id
|
81
81
|
end
|
82
82
|
|
83
|
+
def test_update_time
|
84
|
+
post :update_time, :id => 1, :work => {"started_at_time"=>"8:15"}
|
85
|
+
assert_response :success
|
86
|
+
now = Time.now
|
87
|
+
expected_time = Time.local(now.year , now.month, now.day, 8, 15)
|
88
|
+
assert_equal expected_time.iso8601, assigns(:work).started_at.iso8601
|
89
|
+
end
|
90
|
+
|
83
91
|
def test_destroy
|
84
92
|
assert_not_nil Work.find(1)
|
85
93
|
|
@@ -106,7 +114,7 @@ class WorksControllerTest < Test::Unit::TestCase
|
|
106
114
|
assert_equal num_tasks, Task.count
|
107
115
|
assert_equal num_open_tasks - 1, Task.find_open.size
|
108
116
|
end
|
109
|
-
|
117
|
+
|
110
118
|
def test_weekly_work_sheet
|
111
119
|
get :weekly_work_sheet, :id => 24
|
112
120
|
end
|
@@ -1,27 +1,45 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper'
|
2
2
|
|
3
|
-
# TODO (uwe): Start application for test. Don't use production environment...
|
4
|
-
|
5
3
|
class BacklogsControllerTest < Test::Unit::TestCase
|
4
|
+
PORT = 4000
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@server_thread = IO.popen("script/server -e test -p #{PORT}")
|
8
|
+
Thread.start do
|
9
|
+
loop do
|
10
|
+
lines = @server_thread.readline
|
11
|
+
#puts lines
|
12
|
+
end
|
13
|
+
end
|
14
|
+
sleep 4
|
15
|
+
end
|
16
|
+
|
17
|
+
def teardown
|
18
|
+
if @server_thread
|
19
|
+
Process.kill("TERM", @server_thread.pid)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
6
23
|
def test_lots_of_requests
|
7
|
-
runs =
|
8
|
-
no_of_threads =
|
9
|
-
hits_per_thread =
|
24
|
+
runs = 3
|
25
|
+
no_of_threads = 2
|
26
|
+
hits_per_thread = 5
|
10
27
|
|
11
|
-
duration = with_timing("First") {
|
12
|
-
|
28
|
+
duration = with_timing("First") {get_burn_down_chart}
|
29
|
+
first_hit_limit = 12
|
30
|
+
assert duration <= first_hit_limit, "Request took #{duration} seconds. Should be less than #{first_hit_limit} seconds."
|
13
31
|
|
14
32
|
runs.times do |run_no|
|
15
|
-
threads = (1..no_of_threads).map do |i|
|
16
|
-
Thread.new do
|
17
|
-
hits_per_thread.times {hit}
|
18
|
-
end
|
19
|
-
end
|
20
33
|
duration = with_timing((run_no+1)*no_of_threads*hits_per_thread, no_of_threads*hits_per_thread) do
|
21
|
-
threads.
|
34
|
+
threads = (1..no_of_threads).map do |i|
|
35
|
+
Thread.new do
|
36
|
+
hits_per_thread.times {get_burn_down_chart}
|
37
|
+
end
|
38
|
+
end
|
22
39
|
threads.each {|thread| thread.join}
|
23
40
|
end
|
24
|
-
|
41
|
+
maximum_duration = 6.0 * no_of_threads * hits_per_thread
|
42
|
+
assert duration <= maximum_duration, "Performance to low. Expected #{maximum_duration} or less, took #{duration}."
|
25
43
|
end
|
26
44
|
end
|
27
45
|
|
@@ -36,10 +54,12 @@ class BacklogsControllerTest < Test::Unit::TestCase
|
|
36
54
|
duration
|
37
55
|
end
|
38
56
|
|
39
|
-
def
|
40
|
-
path = 'parties/burn_down_chart/1'
|
41
|
-
|
42
|
-
|
57
|
+
def get_burn_down_chart
|
58
|
+
path = '/parties/burn_down_chart/1'
|
59
|
+
Net::HTTP::start('localhost', port = PORT) do |http|
|
60
|
+
response = http.get path
|
61
|
+
assert response.body =~ /^.PNG/
|
62
|
+
end
|
43
63
|
end
|
44
64
|
|
45
65
|
end
|
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.13.
|
7
|
-
date: 2007-11-
|
6
|
+
version: 0.13.1
|
7
|
+
date: 2007-11-17 00:00:00 +01:00
|
8
8
|
summary: Application to aid collecting, processing, organizing, reviewing and doing tasks.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -433,16 +433,18 @@ files:
|
|
433
433
|
- app/views/layouts/_notice.rhtml
|
434
434
|
- app/views/layouts/_headers.rhtml
|
435
435
|
- app/views/backlogs
|
436
|
+
- app/views/backlogs/move_task_to_period.rjs
|
436
437
|
- app/views/backlogs/_name_list.rhtml
|
437
438
|
- app/views/backlogs/list.rhtml
|
438
439
|
- app/views/backlogs/_buttons.rhtml
|
440
|
+
- app/views/backlogs/finish_task.rjs
|
439
441
|
- app/views/backlogs/show.rhtml
|
440
442
|
- app/views/backlogs/_form.rhtml
|
441
443
|
- app/views/backlogs/new.rhtml
|
442
444
|
- app/views/backlogs/edit.rhtml
|
443
445
|
- app/views/backlogs/_tasks.rhtml
|
446
|
+
- app/views/backlogs/reopen_task.rjs
|
444
447
|
- app/views/estimates
|
445
|
-
- app/views/estimates/create_ajax.rjs
|
446
448
|
- app/views/groups
|
447
449
|
- app/views/groups/list.rhtml
|
448
450
|
- app/views/groups/_form.rhtml
|
@@ -461,17 +463,15 @@ files:
|
|
461
463
|
- app/views/tasks
|
462
464
|
- app/views/tasks/_backlog_header.rhtml
|
463
465
|
- app/views/tasks/list.rhtml
|
464
|
-
- app/views/tasks/move_to_period.rjs
|
465
466
|
- app/views/tasks/_form.rhtml
|
466
467
|
- app/views/tasks/_period_header.rhtml
|
467
|
-
- app/views/tasks/
|
468
|
+
- app/views/tasks/update_estimate.rjs
|
468
469
|
- app/views/tasks/new.rhtml
|
469
470
|
- app/views/tasks/start_work.rjs
|
470
471
|
- app/views/tasks/_fields_header.rhtml
|
471
472
|
- app/views/tasks/_completed.rhtml
|
472
473
|
- app/views/tasks/edit.rhtml
|
473
474
|
- app/views/tasks/list_started.rhtml
|
474
|
-
- app/views/tasks/reopen.rjs
|
475
475
|
- app/views/tasks/_task.rhtml
|
476
476
|
- app/views/customers
|
477
477
|
- app/views/customers/list.rhtml
|
@@ -503,6 +503,8 @@ files:
|
|
503
503
|
- app/views/user_notify/signup_en.rhtml
|
504
504
|
- app/views/redirect.rjs
|
505
505
|
- app/views/periods
|
506
|
+
- app/views/periods/move_task_to_period.rjs
|
507
|
+
- app/views/periods/finish_task.rjs
|
506
508
|
- app/views/periods/show.rhtml
|
507
509
|
- app/views/periods/_show_active.rhtml
|
508
510
|
- app/views/periods/_form.rhtml
|
@@ -511,6 +513,7 @@ files:
|
|
511
513
|
- app/views/periods/_title.rhtml
|
512
514
|
- app/views/periods/_link.rhtml
|
513
515
|
- app/views/periods/_burn_down_chart.rhtml
|
516
|
+
- app/views/periods/reopen_task.rjs
|
514
517
|
test_files:
|
515
518
|
- test/performance/test_threaded.rb
|
516
519
|
- test/test_helper.rb
|
@@ -1,11 +0,0 @@
|
|
1
|
-
page.replace_html :notice, @message
|
2
|
-
page.visual_effect(:appear, :notice)
|
3
|
-
if @success
|
4
|
-
if @task.completed?
|
5
|
-
page.visual_effect :fade, "task_#{@task.id}"
|
6
|
-
page.remove "task_#{@task.id}"
|
7
|
-
page.insert_html :bottom, :completed_tasks, :partial => '/tasks/task'
|
8
|
-
page.visual_effect :appear, "task_#{@task.id}"
|
9
|
-
end
|
10
|
-
update_burn_down_chart(page)
|
11
|
-
end
|