backlog 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +15 -0
- data/app/controllers/application.rb +17 -0
- data/app/controllers/customers_controller.rb +51 -0
- data/app/controllers/estimates_controller.rb +3 -4
- data/app/controllers/tasks_controller.rb +20 -32
- data/app/helpers/application_helper.rb +11 -2
- data/app/helpers/customers_helper.rb +2 -0
- data/app/helpers/tasks_helper.rb +69 -0
- data/app/views/customers/_form.rhtml +7 -0
- data/app/views/customers/edit.rhtml +9 -0
- data/app/views/customers/list.rhtml +27 -0
- data/app/views/customers/new.rhtml +8 -0
- data/app/views/customers/show.rhtml +8 -0
- data/app/views/periods/_show_active.rhtml +13 -10
- data/app/views/redirect.rjs +1 -0
- data/app/views/redirect.rjs~ +0 -0
- data/app/views/tasks/_fields_header.rhtml +1 -1
- data/app/views/tasks/_form.rhtml +6 -1
- data/app/views/tasks/_task.rhtml +3 -3
- data/app/views/tasks/finish.rjs +4 -0
- data/app/views/tasks/move_to_period.rjs +4 -0
- data/app/views/tasks/reopen.rjs +4 -24
- data/config/boot.rb +1 -10
- data/public/javascripts/builder.js +136 -0
- data/public/javascripts/controls.js +486 -354
- data/public/javascripts/dragdrop.js +82 -52
- data/public/javascripts/effects.js +398 -364
- data/public/javascripts/prototype.js +2764 -1095
- data/public/javascripts/scriptaculous.js +58 -0
- data/public/javascripts/slider.js +275 -0
- data/public/javascripts/sound.js +55 -0
- data/public/javascripts/unittest.js +568 -0
- data/test/functional/backlogs_controller_test.rb +1 -1
- data/test/functional/customers_controller_test.rb +93 -0
- data/test/functional/tasks_controller_test.rb +4 -8
- data/test/functional/work_accounts_controller_test.rb +1 -1
- data/test/performance/test_threaded.rb +40 -31
- data/test/test_helper.rb +4 -2
- metadata +20 -3
- data/app/views/tasks/finish_ajax.rjs +0 -25
@@ -0,0 +1,93 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'customers_controller'
|
3
|
+
|
4
|
+
# Re-raise errors caught by the controller.
|
5
|
+
class CustomersController; def rescue_action(e) raise e end; end
|
6
|
+
|
7
|
+
class CustomersControllerTest < Test::Unit::TestCase
|
8
|
+
fixtures :customers
|
9
|
+
|
10
|
+
def setup
|
11
|
+
@controller = CustomersController.new
|
12
|
+
@request = ActionController::TestRequest.new
|
13
|
+
@response = ActionController::TestResponse.new
|
14
|
+
|
15
|
+
@request.session[:user_id] = 1000001
|
16
|
+
@first_id = customers(:one).id
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_index
|
20
|
+
get :index
|
21
|
+
assert_response :success
|
22
|
+
assert_template 'list'
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_list
|
26
|
+
get :list
|
27
|
+
|
28
|
+
assert_response :success
|
29
|
+
assert_template 'list'
|
30
|
+
|
31
|
+
assert_not_nil assigns(:customers)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_show
|
35
|
+
get :show, :id => @first_id
|
36
|
+
|
37
|
+
assert_response :success
|
38
|
+
assert_template 'show'
|
39
|
+
|
40
|
+
assert_not_nil assigns(:customer)
|
41
|
+
assert assigns(:customer).valid?
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_new
|
45
|
+
get :new
|
46
|
+
|
47
|
+
assert_response :success
|
48
|
+
assert_template 'new'
|
49
|
+
|
50
|
+
assert_not_nil assigns(:customer)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_create
|
54
|
+
num_customers = Customer.count
|
55
|
+
|
56
|
+
post :create, :customer => {:name => 'Onkel Skrue'}
|
57
|
+
|
58
|
+
assert_response :redirect
|
59
|
+
assert_redirected_to :action => 'list'
|
60
|
+
|
61
|
+
assert_equal num_customers + 1, Customer.count
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_edit
|
65
|
+
get :edit, :id => @first_id
|
66
|
+
|
67
|
+
assert_response :success
|
68
|
+
assert_template 'edit'
|
69
|
+
|
70
|
+
assert_not_nil assigns(:customer)
|
71
|
+
assert assigns(:customer).valid?
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_update
|
75
|
+
post :update, :id => @first_id
|
76
|
+
assert_response :redirect
|
77
|
+
assert_redirected_to :action => 'show', :id => @first_id
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_destroy
|
81
|
+
assert_nothing_raised {
|
82
|
+
Customer.find(@first_id)
|
83
|
+
}
|
84
|
+
|
85
|
+
post :destroy, :id => @first_id
|
86
|
+
assert_response :redirect
|
87
|
+
assert_redirected_to :action => 'list'
|
88
|
+
|
89
|
+
assert_raise(ActiveRecord::RecordNotFound) {
|
90
|
+
Customer.find(@first_id)
|
91
|
+
}
|
92
|
+
end
|
93
|
+
end
|
@@ -211,8 +211,7 @@ class TasksControllerTest < Test::Unit::TestCase
|
|
211
211
|
|
212
212
|
post :move_to_next_period, :id => tasks(:another).id
|
213
213
|
|
214
|
-
assert_response :
|
215
|
-
assert_redirected_to :controller => 'periods', :action => :show, :id => periods(:active)
|
214
|
+
assert_response :success
|
216
215
|
|
217
216
|
after = Task.find(tasks(:another).id)
|
218
217
|
assert_equal tasks(:another).period_id, after.period_id
|
@@ -229,8 +228,7 @@ class TasksControllerTest < Test::Unit::TestCase
|
|
229
228
|
|
230
229
|
post :move_to_next_period, :id => task.id
|
231
230
|
|
232
|
-
assert_response :
|
233
|
-
assert_redirected_to :controller => 'periods', :action => :show, :id => periods(:past)
|
231
|
+
assert_response :success
|
234
232
|
|
235
233
|
after = Task.find(task.id)
|
236
234
|
assert_equal task.period_id, after.period_id
|
@@ -247,8 +245,7 @@ class TasksControllerTest < Test::Unit::TestCase
|
|
247
245
|
|
248
246
|
post :move_to_next_period, :id => tasks(:in_last_period).id
|
249
247
|
|
250
|
-
assert_response :
|
251
|
-
assert_redirected_to :controller => 'periods', :action => :new, :period => {:party_id => 1}
|
248
|
+
assert_response :success
|
252
249
|
|
253
250
|
before.reload
|
254
251
|
assert_equal tasks(:in_last_period).period_id, before.period_id
|
@@ -263,8 +260,7 @@ class TasksControllerTest < Test::Unit::TestCase
|
|
263
260
|
|
264
261
|
post :move_to_next_period, :id => before.id
|
265
262
|
|
266
|
-
assert_response :
|
267
|
-
assert_redirected_to :controller => 'periods', :action => :show, :id => periods(:ancient).id
|
263
|
+
assert_response :success
|
268
264
|
|
269
265
|
after = Task.find(before.id)
|
270
266
|
assert_equal before.period_id, after.period_id
|
@@ -1,36 +1,45 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
runs = 5
|
4
|
-
no_of_threads = 10
|
5
|
-
hits_per_thread = 20
|
6
|
-
|
7
|
-
def with_timing title = "Time", count = 1
|
8
|
-
start = Time.now
|
9
|
-
yield
|
10
|
-
stop = Time.now
|
11
|
-
duration = stop-start
|
12
|
-
puts "#{title}: #{duration}, #{count/(duration) if count}"
|
13
|
-
duration
|
14
|
-
end
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
15
2
|
|
16
|
-
|
17
|
-
path = 'parties/burn_down_chart/1'
|
18
|
-
system 'GET http://localhost:3000/#{path} >/dev/null'
|
19
|
-
#system 'GET http://localhost:8080/backlog/#{path} >/dev/null'
|
20
|
-
end
|
21
|
-
|
22
|
-
duration = with_timing("First") {hit}
|
23
|
-
exit 1 if duration > 5
|
3
|
+
# TODO (uwe): Start application for test. Don't use production environment...
|
24
4
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
5
|
+
class BacklogsControllerTest < Test::Unit::TestCase
|
6
|
+
def test_lots_of_requests
|
7
|
+
runs = 5
|
8
|
+
no_of_threads = 10
|
9
|
+
hits_per_thread = 20
|
10
|
+
|
11
|
+
duration = with_timing("First") {hit}
|
12
|
+
assert duration <= 5
|
13
|
+
|
14
|
+
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
|
+
duration = with_timing((run_no+1)*no_of_threads*hits_per_thread, no_of_threads*hits_per_thread) do
|
21
|
+
threads.each {|thread| thread.run}
|
22
|
+
threads.each {|thread| thread.join}
|
23
|
+
end
|
24
|
+
assert duration <= 90
|
29
25
|
end
|
30
26
|
end
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def with_timing title = "Time", count = 1
|
31
|
+
start = Time.now
|
32
|
+
yield
|
33
|
+
stop = Time.now
|
34
|
+
duration = stop-start
|
35
|
+
puts "#{title}: #{'%.1f' % duration}s, #{(count/duration).to_i if count}/s"
|
36
|
+
duration
|
37
|
+
end
|
38
|
+
|
39
|
+
def hit
|
40
|
+
path = 'parties/burn_down_chart/1'
|
41
|
+
system 'GET http://localhost:3000/#{path} >/dev/null'
|
42
|
+
#system 'GET http://localhost:8080/backlog/#{path} >/dev/null'
|
34
43
|
end
|
35
|
-
|
36
|
-
end
|
44
|
+
|
45
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -4,8 +4,10 @@ require 'test_help'
|
|
4
4
|
require 'user_notify'
|
5
5
|
|
6
6
|
class Test::Unit::TestCase
|
7
|
-
|
8
|
-
|
7
|
+
def self.main_scenario
|
8
|
+
fixtures :parties, :users, :groups, :groups_users, :work_accounts, :backlogs, :periods, :tasks, :task_files, :works, :estimates
|
9
|
+
end
|
10
|
+
|
9
11
|
# Transactional fixtures accelerate your tests by wrapping each test method
|
10
12
|
# in a transaction that's rolled back on completion. This ensures that the
|
11
13
|
# test database remains unchanged so your fixtures don't have to be reloaded
|
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.12.
|
7
|
-
date: 2007-11-
|
6
|
+
version: 0.12.1
|
7
|
+
date: 2007-11-08 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
|
@@ -79,7 +79,10 @@ files:
|
|
79
79
|
- public/javascripts/controls.js
|
80
80
|
- public/javascripts/effects.js
|
81
81
|
- public/javascripts/prototype.js
|
82
|
+
- public/javascripts/unittest.js
|
82
83
|
- public/javascripts/application.js
|
84
|
+
- public/javascripts/sound.js
|
85
|
+
- public/javascripts/scriptaculous.js
|
83
86
|
- public/javascripts/zapatec
|
84
87
|
- public/javascripts/zapatec/utils
|
85
88
|
- public/javascripts/zapatec/utils/utils.js
|
@@ -95,6 +98,8 @@ files:
|
|
95
98
|
- public/javascripts/zapatec/zpcal/src/calendar-date-core.js
|
96
99
|
- public/javascripts/zapatec/zpcal/src/calendar-core.js
|
97
100
|
- public/javascripts/zapatec/zpcal/src/calendar.js
|
101
|
+
- public/javascripts/slider.js
|
102
|
+
- public/javascripts/builder.js
|
98
103
|
- public/javascripts/dragdrop.js
|
99
104
|
- "public/Frav\xC3\xA6rsskjema.xls"
|
100
105
|
- public/stylesheets
|
@@ -159,6 +164,7 @@ files:
|
|
159
164
|
- test/performance/test.rb
|
160
165
|
- test/performance/test_threaded.rb
|
161
166
|
- test/functional
|
167
|
+
- test/functional/customers_controller_test.rb
|
162
168
|
- test/functional/work_accounts_controller_test.rb
|
163
169
|
- test/functional/task_files_controller_test.rb
|
164
170
|
- test/functional/parties_controller_test.rb
|
@@ -369,6 +375,7 @@ files:
|
|
369
375
|
- app/controllers
|
370
376
|
- app/controllers/groups_controller.rb
|
371
377
|
- app/controllers/tasks_controller.rb
|
378
|
+
- app/controllers/customers_controller.rb
|
372
379
|
- app/controllers/search_controller.rb
|
373
380
|
- app/controllers/estimates_controller.rb
|
374
381
|
- app/controllers/backlogs_controller.rb
|
@@ -386,6 +393,7 @@ files:
|
|
386
393
|
- app/helpers/work_accounts_helper.rb
|
387
394
|
- app/helpers/application_helper.rb
|
388
395
|
- app/helpers/tasks_helper.rb
|
396
|
+
- app/helpers/customers_helper.rb
|
389
397
|
- app/helpers/task_files_helper.rb
|
390
398
|
- app/helpers/groups_helper.rb
|
391
399
|
- app/helpers/works_helper.rb
|
@@ -454,9 +462,10 @@ files:
|
|
454
462
|
- app/views/tasks
|
455
463
|
- app/views/tasks/_backlog_header.rhtml
|
456
464
|
- app/views/tasks/list.rhtml
|
457
|
-
- app/views/tasks/
|
465
|
+
- app/views/tasks/move_to_period.rjs
|
458
466
|
- app/views/tasks/_form.rhtml
|
459
467
|
- app/views/tasks/_period_header.rhtml
|
468
|
+
- app/views/tasks/finish.rjs
|
460
469
|
- app/views/tasks/new.rhtml
|
461
470
|
- app/views/tasks/start_work.rjs
|
462
471
|
- app/views/tasks/_fields_header.rhtml
|
@@ -465,6 +474,12 @@ files:
|
|
465
474
|
- app/views/tasks/list_started.rhtml
|
466
475
|
- app/views/tasks/reopen.rjs
|
467
476
|
- app/views/tasks/_task.rhtml
|
477
|
+
- app/views/customers
|
478
|
+
- app/views/customers/list.rhtml
|
479
|
+
- app/views/customers/show.rhtml
|
480
|
+
- app/views/customers/_form.rhtml
|
481
|
+
- app/views/customers/new.rhtml
|
482
|
+
- app/views/customers/edit.rhtml
|
468
483
|
- app/views/works
|
469
484
|
- app/views/works/list.rhtml
|
470
485
|
- app/views/works/_buttons.rhtml
|
@@ -486,6 +501,7 @@ files:
|
|
486
501
|
- app/views/user_notify/change_password_en.rhtml
|
487
502
|
- app/views/user_notify/forgot_password_en.rhtml
|
488
503
|
- app/views/user_notify/signup_en.rhtml
|
504
|
+
- app/views/redirect.rjs
|
489
505
|
- app/views/periods
|
490
506
|
- app/views/periods/show.rhtml
|
491
507
|
- app/views/periods/_show_active.rhtml
|
@@ -495,6 +511,7 @@ files:
|
|
495
511
|
- app/views/periods/_title.rhtml
|
496
512
|
- app/views/periods/_link.rhtml
|
497
513
|
- app/views/periods/_burn_down_chart.rhtml
|
514
|
+
- app/views/redirect.rjs~
|
498
515
|
test_files:
|
499
516
|
- test/performance/test_threaded.rb
|
500
517
|
- test/test_helper.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
page.replace_html :notice, @message
|
2
|
-
page.visual_effect(:appear, :notice)
|
3
|
-
|
4
|
-
page.visual_effect :fade, "task_#{@task.id}"
|
5
|
-
page.remove "task_#{@task.id}"
|
6
|
-
|
7
|
-
if @last_active_in_backlog
|
8
|
-
page.select('#active_tasks tr').first.remove
|
9
|
-
page.select('#active_tasks tr').first.remove
|
10
|
-
end
|
11
|
-
|
12
|
-
if @last_active
|
13
|
-
page.visual_effect :appear, "no_tasks_message"
|
14
|
-
end
|
15
|
-
|
16
|
-
unless @first_finished
|
17
|
-
page.select('#completed_tasks tr').first.remove
|
18
|
-
end
|
19
|
-
|
20
|
-
page.insert_html :top, :completed_tasks, :partial => '/tasks/task', :locals => {:active => false, :hidden => true, :highlight_task => false}
|
21
|
-
page.visual_effect :appear, "task_#{@task.id}"
|
22
|
-
|
23
|
-
page.insert_html :top, :completed_tasks, :partial => '/tasks/fields_header', :locals => {:backlog => @task.backlog, :active => false}
|
24
|
-
|
25
|
-
page['burn_down_chart'].src = url_for(:controller => 'periods', :action => :burn_down_chart_thumbnail, :id => @task.period_id, :rnd => rand)
|