backlog 0.35.5 → 0.36.2

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.
Files changed (150) hide show
  1. data/Gemfile +19 -0
  2. data/Gemfile~ +4 -0
  3. data/History.txt +25 -0
  4. data/Rakefile +3 -3
  5. data/app/controllers/{application.rb → application_controller.rb} +1 -2
  6. data/app/controllers/backlogs_controller.rb +0 -16
  7. data/app/controllers/search_controller.rb +0 -2
  8. data/app/controllers/user_controller.rb +7 -7
  9. data/app/controllers/work_locks_controller.rb +2 -2
  10. data/app/controllers/works_controller.rb +23 -23
  11. data/app/helpers/application_helper.rb +9 -6
  12. data/app/helpers/backlogs_helper.rb +1 -1
  13. data/app/helpers/periods_helper.rb +1 -1
  14. data/app/models/backlog.rb +13 -10
  15. data/app/models/period.rb +0 -5
  16. data/app/models/sidebar.rb +1 -0
  17. data/app/models/task.rb +4 -10
  18. data/app/models/user.rb +5 -6
  19. data/app/models/user_notify.rb +0 -1
  20. data/app/models/work.rb +20 -25
  21. data/app/models/works_report_filter.rb +4 -4
  22. data/app/views/backlogs/_buttons.rhtml +1 -1
  23. data/app/views/backlogs/_form.rhtml +5 -9
  24. data/app/views/layouts/_left_top.rhtml +0 -1
  25. data/app/views/periods/_form.rhtml +1 -1
  26. data/app/views/search/results.rhtml +1 -12
  27. data/app/views/task_notify/{invite_en.rhtml → invite.en.html.erb} +0 -0
  28. data/app/views/task_notify/{invite_no.rhtml → invite.no.html.erb} +0 -0
  29. data/app/views/tasks/_task.rhtml +49 -50
  30. data/app/views/tasks/edit.rhtml +4 -4
  31. data/app/views/tasks/start_work.rjs +1 -1
  32. data/app/views/user/_edit.rhtml +1 -1
  33. data/app/views/user/change_password.rhtml +1 -1
  34. data/app/views/user/edit.rhtml +4 -4
  35. data/app/views/user/signup.rhtml +2 -2
  36. data/app/views/user_notify/{change_password_en.rhtml → change_password.en.html.erb} +0 -0
  37. data/app/views/user_notify/{change_password_no.rhtml → change_password.no.html.erb} +0 -0
  38. data/app/views/user_notify/{forgot_password_en.rhtml → forgot_password.en.html.erb} +0 -0
  39. data/app/views/user_notify/{forgot_password_no.rhtml → forgot_password.no.html.erb} +0 -0
  40. data/app/views/user_notify/{monitoring_en.rhtml → monitoring.en.html.erb} +0 -0
  41. data/app/views/user_notify/{monitoring_no.rhtml → monitoring.no.html.erb} +0 -0
  42. data/app/views/user_notify/{monitoring_invitation_en.rhtml → monitoring_invitation.en.html.erb} +0 -0
  43. data/app/views/user_notify/{monitoring_invitation_no.rhtml → monitoring_invitation.no.html.erb} +0 -0
  44. data/app/views/user_notify/{signup_en.rhtml → signup.en.html.erb} +0 -0
  45. data/app/views/user_notify/{signup_no.rhtml → signup.no.html.erb} +0 -0
  46. data/app/views/work_lock_notify/{lock_en.rhtml → lock.en.html.erb} +0 -0
  47. data/app/views/work_lock_notify/{lock_no.rhtml → lock.no.html.erb} +0 -0
  48. data/app/views/work_lock_notify/{nag_en.rhtml → nag.en.html.erb} +0 -0
  49. data/app/views/work_lock_notify/{nag_no.rhtml → nag.no.html.erb} +0 -0
  50. data/app/views/works/_form.rhtml +6 -6
  51. data/app/views/works/_new_row.rhtml +6 -6
  52. data/app/views/works/_row.rhtml +2 -2
  53. data/app/views/works/daily_work_sheet.rhtml +1 -1
  54. data/app/views/works/list.rhtml +6 -6
  55. data/app/views/works/list_excel.rhtml +8 -4
  56. data/app/views/works/timeliste.rhtml +14 -14
  57. data/app/views/works/update_row.rjs +1 -1
  58. data/app/views/works/weekly_work_sheet.rhtml +5 -5
  59. data/app/views/works/weekly_work_sheet_details.rhtml +5 -5
  60. data/config/boot.rb +108 -27
  61. data/config/database.yml +3 -26
  62. data/config/environment.rb +4 -12
  63. data/config/environments/development.rb +0 -1
  64. data/config/initializers/jdbc.rb +7 -0
  65. data/config/initializers/mongrel.rb +83 -0
  66. data/config/locales/en.yml +189 -0
  67. data/config/locales/no.yml +192 -0
  68. data/config/preinitializer.rb +20 -0
  69. data/cruise_build.sh +10 -0
  70. data/cruise_config.rb +1 -1
  71. data/db/migrate/20100720124707_merge_work_account_into_backlog.rb +74 -0
  72. data/db/schema.rb +93 -127
  73. data/lib/class_table_inheritance.rb +53 -11
  74. data/lib/tasks/jdbc.rake +8 -0
  75. data/lib/user_system.rb +5 -1
  76. data/public/javascripts/controls.js +76 -79
  77. data/public/javascripts/dragdrop.js +166 -167
  78. data/public/javascripts/effects.js +174 -168
  79. data/public/javascripts/prototype.js +470 -334
  80. data/public/stylesheets/mwrt002.css +6 -6
  81. data/script/dbconsole +3 -0
  82. data/test/fixtures/backlogs.yml +2 -2
  83. data/test/fixtures/work_lock_subscriptions.yml +2 -2
  84. data/test/fixtures/works.yml +6 -6
  85. data/test/functional/absences_controller_test.rb +1 -1
  86. data/test/functional/backlogs_controller_test.rb +4 -4
  87. data/test/functional/customers_controller_test.rb +1 -1
  88. data/test/functional/dashboard_controller_test.rb +1 -1
  89. data/test/functional/estimates_controller_test.rb +1 -1
  90. data/test/functional/groups_controller_test.rb +1 -1
  91. data/test/functional/parties_controller_test.rb +1 -1
  92. data/test/functional/periods_controller_test.rb +1 -1
  93. data/test/functional/public_holidays_controller_test.rb +1 -1
  94. data/test/functional/search_controller_test.rb +1 -1
  95. data/test/functional/task_files_controller_test.rb +1 -1
  96. data/test/functional/tasks_controller_test.rb +6 -6
  97. data/test/functional/user_controller_test.rb +3 -2
  98. data/test/functional/welcome_controller_test.rb +1 -1
  99. data/test/functional/work_locks_controller_test.rb +1 -1
  100. data/test/functional/works_controller_test.rb +11 -11
  101. data/test/test_helper.rb +2 -2
  102. data/test/unit/absence_test.rb +1 -1
  103. data/test/unit/configuration_test.rb +1 -1
  104. data/test/unit/customer_test.rb +1 -1
  105. data/test/unit/estimate_test.rb +1 -1
  106. data/test/unit/group_test.rb +1 -1
  107. data/test/unit/party_test.rb +1 -1
  108. data/test/unit/period_test.rb +1 -1
  109. data/test/unit/public_holiday_test.rb +1 -1
  110. data/test/unit/task_file_test.rb +1 -1
  111. data/test/unit/task_test.rb +1 -1
  112. data/test/unit/user_test.rb +1 -1
  113. data/test/unit/work_lock_subscription_test.rb +1 -1
  114. data/test/unit/work_lock_test.rb +1 -1
  115. data/test/unit/work_test.rb +8 -8
  116. data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +3 -3
  117. data/vendor/plugins/assert_cookie/lib/assert_cookie.rb +2 -2
  118. data/vendor/plugins/auto_complete/README +23 -0
  119. data/vendor/plugins/auto_complete/Rakefile +22 -0
  120. data/vendor/plugins/auto_complete/init.rb +2 -0
  121. data/vendor/plugins/auto_complete/lib/auto_complete.rb +47 -0
  122. data/vendor/plugins/auto_complete/lib/auto_complete_macros_helper.rb +143 -0
  123. data/vendor/plugins/auto_complete/test/auto_complete_test.rb +67 -0
  124. data/vendor/plugins/backlog_jira/init.rb +4 -0
  125. data/vendor/plugins/backlog_jira/{tasks → lib/tasks}/backlog_jira_tasks.rake +0 -0
  126. data/vendor/plugins/has_history/{tasks → lib/tasks}/has_history_tasks.rake +0 -0
  127. metadata +745 -817
  128. data/#SearchRequest.xml# +0 -3443
  129. data/app/controllers/application.rb~ +0 -207
  130. data/app/controllers/work_accounts_controller.rb +0 -58
  131. data/app/helpers/work_accounts_helper.rb +0 -2
  132. data/app/models/work_account.rb +0 -18
  133. data/app/models/work_lock_subscription.rb +0 -3
  134. data/app/views/work_accounts/_form.rhtml +0 -16
  135. data/app/views/work_accounts/_name_list.rhtml +0 -5
  136. data/app/views/work_accounts/_title.rhtml +0 -5
  137. data/app/views/work_accounts/edit.rhtml +0 -12
  138. data/app/views/work_accounts/list.rhtml +0 -31
  139. data/app/views/work_accounts/new.rhtml +0 -10
  140. data/app/views/work_accounts/show.rhtml +0 -50
  141. data/config/environments/localization_environment.rb +0 -10
  142. data/jira.log +0 -98246
  143. data/lang/en.yaml +0 -147
  144. data/lang/localizations.yaml +0 -2
  145. data/lang/no.yaml +0 -146
  146. data/lib/localization.rb +0 -88
  147. data/test/fixtures/work_accounts.yml +0 -7
  148. data/test/functional/work_accounts_controller_test.rb +0 -94
  149. data/test/unit/localization_test.rb +0 -47
  150. data/test/unit/work_account_test.rb +0 -10
@@ -13,8 +13,8 @@ a:hover {font-weight:bold; color:#FF9900; background-color: #FFFFFF; text-decora
13
13
  table {padding:0px; margin:0px; width:inherit;}
14
14
  tbody {padding:0px; margin:0px; width:inherit;}
15
15
  th {padding:2px; margin:0px; width:inherit;}
16
- #wrap {width:793px; text-align:left; margin:auto;}
17
- #leftcol {width:580px; float:left; vertical-align:top; padding:4px 2px 4px 4px;}
16
+ #wrap {width:1193px; text-align:left; margin:auto;}
17
+ #leftcol {width:880px; float:left; vertical-align:top; padding:4px 2px 4px 4px;}
18
18
  #navbar {background-color:#F0F0F0; color:#777777; margin:0px 0px 5px 0; padding:5px; border:1px solid #333333; text-align:right;}
19
19
  #navbar a {font-weight:bold; color:#5B7C7C; background-color: #F0F0F0; text-decoration:none; border-bottom:1px dashed #333333;} /* unvisited links */
20
20
  #navbar a:hover {font-weight:bold; color:#FF9900; background-color: #F0F0F0; text-decoration:none; border-bottom:1px solid #999999;} /* user hovers */
@@ -22,18 +22,18 @@ th {padding:2px; margin:0px; width:inherit;}
22
22
  #introtext {margin:25px 10px 10px 10px;}
23
23
  #spotlight {background-color:#FFFFFF; color:#000000; margin:0px 0px 5px 0; padding:5px; border:1px solid #333333;}
24
24
  #spotlight img {padding:3px 4px 0px 0; float:left;}
25
- #lfeature {background-color:#FFFFFF; color:#000000; margin:0px 1px 5px 0; padding:5px; border:1px solid #333333; width:275px; float:left;}
25
+ #lfeature {background-color:#FFFFFF; color:#000000; margin:0px 1px 5px 0; padding:5px; border:1px solid #333333; width:425px; float:left;}
26
26
  #lfeature img {padding:3px 4px 0px 0; float:left;}
27
- #rfeature {background-color:#FFFFFF; color:#000000; margin:0px 0px 5px 1px; padding:5px; border:1px solid #333333; width:275px; float:right;}
27
+ #rfeature {background-color:#FFFFFF; color:#000000; margin:0px 0px 5px 1px; padding:5px; border:1px solid #333333; width:425px; float:right;}
28
28
  #rfeature img {padding:3px 4px 0px 0; float:left;}
29
29
  #maincontent {clear:both;}
30
30
  .mainblock {background-color:#FFFFFF; color:#000000; margin:0px 0px 5px 0; padding:5px; border:1px solid #333333;}
31
31
  #banners {clear:both; margin:5px; padding:5px; text-align:center;}
32
32
  #footer {clear:both; text-align:center;}
33
- #footertext {background-color:#F0F0F0; color:#5B7C7C; margin:auto; padding:5px; border:1px solid #333333; height:30px; width:775px;}
33
+ #footertext {background-color:#F0F0F0; color:#5B7C7C; margin:auto; padding:5px; border:1px solid #333333; height:30px; width:1175px;}
34
34
  #footertext a {font-weight:bold; color:#5B7C7C; background-color: #F0F0F0; text-decoration:none; border-bottom:1px dashed #333333;} /* unvisited links */
35
35
  #footertext a:hover {font-weight:bold; color:#FF9900; background-color: #F0F0F0; text-decoration:none; border-bottom:1px solid #5B7C7C;} /* user hovers */
36
- #rightcol {width:200px; float:right; vertical-align:top; padding:4px 4px 4px 2px;}
36
+ #rightcol {width:300px; float:right; vertical-align:top; padding:4px 4px 4px 2px;}
37
37
  .rblock {background-color:#FFFFFF; color:#000000; margin:0px 0px 5px 0; padding:5px; border:1px solid #333333;}
38
38
  .btitle {display: block; clear:both; padding:2px; margin:0px 0px 2px 0; border-bottom:1px dashed #999999;}
39
39
  #rightcol .btitle {display: block; clear:both; padding:2px; margin:0px 0px 2px 0; border:1px solid #999999; background-color:#F0F0F0; color:#333333;}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/dbconsole'
@@ -1,8 +1,8 @@
1
1
  first:
2
2
  id: 1
3
3
  name: My backlog
4
- work_account_id: 1
4
+ track_times: false
5
5
  another:
6
6
  id: 2
7
7
  name: Your backlog
8
- work_account_id: 2
8
+ track_times: true
@@ -1,7 +1,7 @@
1
1
  # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
2
  one:
3
3
  subscriber_user_id: 1000001
4
- work_account_id: 1
4
+ backlog_id: 1
5
5
  two:
6
6
  subscriber_user_id: 1000001
7
- work_account_id: 2
7
+ backlog_id: 2
@@ -6,13 +6,13 @@ first:
6
6
  start_time: !time 13:35:00
7
7
  completed_at: 2007-06-12T14:35:00
8
8
  hours: 30.0
9
- work_account_id: 1
9
+ backlog_id: 1
10
10
  started:
11
11
  id: 2
12
12
  task_id: 4
13
13
  started_on: 2007-06-12
14
14
  start_time: !time 13:35:00
15
- work_account_id: 1
15
+ backlog_id: 1
16
16
  personal:
17
17
  id: 3
18
18
  task_id: 1
@@ -21,17 +21,17 @@ personal:
21
21
  completed_at: 2007-06-12T14:35:00
22
22
  user_id: 1000001
23
23
  hours: 40.0
24
- work_account_id: 1
24
+ backlog_id: 1
25
25
  brother_of_started:
26
26
  id: 5
27
27
  task_id: 4
28
28
  started_on: 2007-06-12
29
29
  start_time: !time 13:35:00
30
30
  completed_at: 2007-06-12T14:35:00
31
- work_account_id: 1
31
+ backlog_id: 1
32
32
  without_task:
33
33
  id: 6
34
- work_account_id: 1
34
+ backlog_id: 1
35
35
  started_on: 2007-06-13
36
36
  start_time: !time 13:35:00
37
37
  completed_at: 2007-06-13T14:35:00
@@ -43,5 +43,5 @@ short:
43
43
  start_time: !time 10:00:00
44
44
  completed_at: 2007-06-18T10:05:00
45
45
  hours: 0.083
46
- work_account_id: 1
46
+ backlog_id: 1
47
47
  user_id: 1000001
@@ -4,7 +4,7 @@ require 'absences_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class AbsencesController; def rescue_action(e) raise e end; end
6
6
 
7
- class AbsencesControllerTest < Test::Unit::TestCase
7
+ class AbsencesControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'backlogs_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class BacklogsController; def rescue_action(e) raise e end; end
6
6
 
7
- class BacklogsControllerTest < Test::Unit::TestCase
7
+ class BacklogsControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -62,10 +62,10 @@ class BacklogsControllerTest < Test::Unit::TestCase
62
62
  def test_create
63
63
  num_backlogs = Backlog.count
64
64
  @request.session[:user_id] = 1000001
65
- post :create, :backlog => {:name => 'house work'}
65
+ post :create, :backlog => {:name => 'house work', :track_times => true}
66
66
 
67
- assert_response :redirect
68
- assert_redirected_to :action => :show
67
+ assert_response :redirect, assigns(:backlog).errors.to_a.inspect
68
+ assert_redirected_to :action => :show, :id => assigns(:backlog).id
69
69
 
70
70
  assert_equal num_backlogs + 1, Backlog.count
71
71
  end
@@ -4,7 +4,7 @@ require 'customers_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class CustomersController; def rescue_action(e) raise e end; end
6
6
 
7
- class CustomersControllerTest < Test::Unit::TestCase
7
+ class CustomersControllerTest < ActionController::TestCase
8
8
  fixtures :customers
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'dashboard_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class DashboardController; def rescue_action(e) raise e end; end
6
6
 
7
- class DashboardControllerTest < Test::Unit::TestCase
7
+ class DashboardControllerTest < ActionController::TestCase
8
8
  def setup
9
9
  @controller = DashboardController.new
10
10
  @request = ActionController::TestRequest.new
@@ -3,7 +3,7 @@ require 'estimates_controller'
3
3
 
4
4
  class EstimatesController; def rescue_action(e) raise e end; end
5
5
 
6
- class EstimatesControllerTest < Test::Unit::TestCase
6
+ class EstimatesControllerTest < ActionController::TestCase
7
7
  main_scenario
8
8
 
9
9
  def setup
@@ -3,7 +3,7 @@ require 'groups_controller'
3
3
 
4
4
  class GroupsController; def rescue_action(e) raise e end; end
5
5
 
6
- class GroupsControllerTest < Test::Unit::TestCase
6
+ class GroupsControllerTest < ActionController::TestCase
7
7
  main_scenario
8
8
 
9
9
  def setup
@@ -4,7 +4,7 @@ require 'parties_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class PartiesController; def rescue_action(e) raise e end; end
6
6
 
7
- class PartiesControllerTest < Test::Unit::TestCase
7
+ class PartiesControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'periods_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class PeriodsController; def rescue_action(e) raise e end; end
6
6
 
7
- class PeriodsControllerTest < Test::Unit::TestCase
7
+ class PeriodsControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'public_holidays_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class PublicHolidaysController; def rescue_action(e) raise e end; end
6
6
 
7
- class PublicHolidaysControllerTest < Test::Unit::TestCase
7
+ class PublicHolidaysControllerTest < ActionController::TestCase
8
8
  fixtures :public_holidays
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'search_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class SearchController; def rescue_action(e) raise e end; end
6
6
 
7
- class SearchControllerTest < Test::Unit::TestCase
7
+ class SearchControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'task_files_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class TaskFilesController; def rescue_action(e) raise e end; end
6
6
 
7
- class TaskFilesControllerTest < Test::Unit::TestCase
7
+ class TaskFilesControllerTest < ActionController::TestCase
8
8
  fixtures :task_files
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'tasks_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class TasksController; def rescue_action(e) raise e end; end
6
6
 
7
- class TasksControllerTest < Test::Unit::TestCase
7
+ class TasksControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -66,7 +66,7 @@ class TasksControllerTest < Test::Unit::TestCase
66
66
  assert_equal [], task.errors.full_messages
67
67
 
68
68
  assert_response :redirect
69
- assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:active)
69
+ assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:active).id, :task => assigns(:task).id
70
70
 
71
71
  assert_equal num_tasks + 1, Task.count
72
72
  end
@@ -80,7 +80,7 @@ class TasksControllerTest < Test::Unit::TestCase
80
80
  assert_equal [], task.errors.full_messages
81
81
 
82
82
  assert_response :redirect
83
- assert_redirected_to :controller => 'backlogs', :action => :edit, :id => 2
83
+ assert_redirected_to :controller => 'backlogs', :action => :edit, :id => 2, :task => task.id
84
84
 
85
85
  assert_equal num_tasks + 1, Task.count
86
86
  end
@@ -126,7 +126,7 @@ class TasksControllerTest < Test::Unit::TestCase
126
126
  post :update, :id => 2, :task => {:description => 'Two'}
127
127
 
128
128
  assert_response :redirect
129
- assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:active)
129
+ assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:active), :task => 2
130
130
 
131
131
  after = Task.find(2)
132
132
  assert_equal 'Two', after.description
@@ -138,7 +138,7 @@ class TasksControllerTest < Test::Unit::TestCase
138
138
  post :update, :id => 2, :task => {:period_id => ''}
139
139
 
140
140
  assert_response :redirect
141
- assert_redirected_to :controller => 'backlogs', :action => 'show', :id => before.backlog
141
+ assert_redirected_to :controller => 'backlogs', :action => 'show', :id => before.backlog, :task => 2
142
142
 
143
143
  after = Task.find(2)
144
144
  assert_equal nil, after.period_id
@@ -200,7 +200,7 @@ class TasksControllerTest < Test::Unit::TestCase
200
200
  post :move_to, :id => subtask.id.to_s, :target_id => supertask.id.to_s
201
201
 
202
202
  assert_response :redirect
203
- assert_redirected_to :controller => 'periods', :action => :show_no_layout, :id => subtask_before.root_task.period_id
203
+ assert_redirected_to :controller => 'periods', :action => :show_no_layout, :id => subtask_before.root_task.period_id, :task => tasks(:subtask).id
204
204
 
205
205
  subtask_after = Task.find(subtask.id)
206
206
  assert_equal subtask.root_task.period_id, subtask_after.period_id
@@ -5,7 +5,7 @@ require 'user_notify'
5
5
  # Raise errors beyond the default web-based presentation
6
6
  class UserController; def rescue_action(e) raise e end; end
7
7
 
8
- class UserControllerTest < Test::Unit::TestCase
8
+ class UserControllerTest < ActionController::TestCase
9
9
  include UserSystem
10
10
 
11
11
  self.use_transactional_fixtures = false
@@ -146,6 +146,7 @@ class UserControllerTest < Test::Unit::TestCase
146
146
  user = users(:tesla)
147
147
  set_logged_in user
148
148
  post :change_password, :user => { :password => "changed_password", :password_onfirmation => "changed_password" }
149
+ assert_response :success
149
150
  assert_equal 1, ActionMailer::Base.deliveries.size
150
151
  mail = ActionMailer::Base.deliveries[0]
151
152
  assert_equal "tesla@example.com", mail.to_addrs[0].to_s
@@ -222,7 +223,7 @@ class UserControllerTest < Test::Unit::TestCase
222
223
  assert_equal @controller.url_for(:controller => 'welcome', :action => :index), @response.redirect_url
223
224
  assert_cookie :autologin, :value => '1000001'
224
225
  assert_cookie :token
225
- assert_not_equal 'random_token_string', cookies['token'].value
226
+ assert_not_equal 'random_token_string', cookies['token']
226
227
  assert_equal false, User.find(1000001).token_expired?
227
228
  assert_not_equal 'random_token_string', User.find(1000001).security_token
228
229
  end
@@ -4,7 +4,7 @@ require 'welcome_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class WelcomeController; def rescue_action(e) raise e end; end
6
6
 
7
- class WelcomeControllerTest < Test::Unit::TestCase
7
+ class WelcomeControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'work_locks_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class WorkLocksController; def rescue_action(e) raise e end; end
6
6
 
7
- class WorkLocksControllerTest < Test::Unit::TestCase
7
+ class WorkLocksControllerTest < ActionController::TestCase
8
8
  fixtures :work_locks
9
9
 
10
10
  def setup
@@ -4,7 +4,7 @@ require 'works_controller'
4
4
  # Re-raise errors caught by the controller.
5
5
  class WorksController; def rescue_action(e) raise e end; end
6
6
 
7
- class WorksControllerTest < Test::Unit::TestCase
7
+ class WorksControllerTest < ActionController::TestCase
8
8
  main_scenario
9
9
 
10
10
  def setup
@@ -78,7 +78,7 @@ class WorksControllerTest < Test::Unit::TestCase
78
78
  def test_create
79
79
  num_works = Work.count
80
80
 
81
- post :create, :work => {:task_id => '1', :started_on => Date.today.to_s, :start_time => Time.now.time_of_day.to_s, :work_account_id => '1'}
81
+ post :create, :work => {:task_id => '1', :started_on => Date.today.to_s, :start_time => Time.now.time_of_day.to_s, :backlog_id => '1'}
82
82
 
83
83
  assert_response :redirect
84
84
  assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:past).id, :task_id => 1
@@ -89,7 +89,7 @@ class WorksControllerTest < Test::Unit::TestCase
89
89
  def test_create_without_start_date
90
90
  num_works = Work.count
91
91
 
92
- post :create, :work => {:task_id => '1', :start_time => Time.now.time_of_day.to_s, :work_account_id => '1'}
92
+ post :create, :work => {:task_id => '1', :start_time => Time.now.time_of_day.to_s, :backlog_id => '1'}
93
93
 
94
94
  assert_response :redirect
95
95
  assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:past).id, :task_id => 1
@@ -100,12 +100,12 @@ class WorksControllerTest < Test::Unit::TestCase
100
100
  def test_create_with_old_start_date
101
101
  num_works = Work.count
102
102
 
103
- post :create, :work => {:task_id => '1', :started_on => '2007-07-31', :work_account_id => '1',
103
+ post :create, :work => {:task_id => '1', :started_on => '2007-07-31', :backlog_id => '1',
104
104
  :start_time => '12:00', :completed_at => '2007-07-31 12:20'}
105
105
 
106
106
  assert_response :redirect
107
107
  assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:past).id, :task_id => 1
108
-
108
+ assert_equal 'Work was successfully created.', flash[:notice]
109
109
  assert_equal num_works + 1, Work.count
110
110
  assert_equal BigDecimal('0.333'), assigns(:work).hours
111
111
  end
@@ -113,7 +113,7 @@ class WorksControllerTest < Test::Unit::TestCase
113
113
  def test_create_with_old_start_date_and_completed_at_time
114
114
  num_works = Work.count
115
115
 
116
- post :create, :work => {:task_id => '1', :started_on => '2007-07-31', :work_account_id => '1',
116
+ post :create, :work => {:task_id => '1', :started_on => '2007-07-31', :backlog_id => '1',
117
117
  :start_time => '12:00', :completed_at_time => '12:20'}
118
118
 
119
119
  assert_response :redirect
@@ -127,9 +127,9 @@ class WorksControllerTest < Test::Unit::TestCase
127
127
  def test_create_with_old_start_date_and_no_times
128
128
  num_works = Work.count
129
129
 
130
- post :create, :work => {:started_on => '2007-07-31', :work_account_id => '1', :hours_time => '3:00'}
130
+ post :create, :work => {:started_on => '2007-07-31', :backlog_id => '1', :hours_time => '3:00'}
131
131
 
132
- assert_response :redirect
132
+ assert_response :redirect, assigns(:work).errors.to_a.inspect
133
133
  assert_redirected_to :controller => 'works', :action => 'daily_work_sheet', :id => '2007-07-31'
134
134
 
135
135
  assert_equal num_works + 1, Work.count
@@ -153,7 +153,7 @@ class WorksControllerTest < Test::Unit::TestCase
153
153
  assert_not_nil assigns(:work)
154
154
  assert_equal([], assigns(:work).errors.full_messages, assigns(:work).inspect)
155
155
  assert_response :redirect
156
- assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:past).id
156
+ assert_redirected_to :controller => 'periods', :action => 'show', :id => periods(:past).id, :task_id => 1
157
157
  end
158
158
 
159
159
  def test_update_time
@@ -191,7 +191,7 @@ class WorksControllerTest < Test::Unit::TestCase
191
191
 
192
192
  post :destroy, :id => 1
193
193
  assert_response :redirect
194
- assert_redirected_to :controller => 'periods', :action => 'list_work'
194
+ assert_redirected_to :controller => 'periods', :action => 'list_work', :id => 2
195
195
 
196
196
  assert_raise(ActiveRecord::RecordNotFound) {
197
197
  Work.find(1)
@@ -207,7 +207,7 @@ class WorksControllerTest < Test::Unit::TestCase
207
207
  post :update, "commit"=>"Lagre", "action"=>"update", "id"=>work.id.to_s, "controller"=>"works", "estimate"=>{"todo"=>"0"}, "work"=>{"completed_at"=>"2007-08-02 14:15", "task_id"=> task.id.to_s, "user_id"=>"1000001", "started_on"=>"2007-08-02", "start_time"=>"14:00"}
208
208
 
209
209
  assert_response :redirect
210
- assert_redirected_to :controller => 'periods', :action => :show, :id => task.period, :task => nil
210
+ assert_redirected_to :controller => 'periods', :action => :show, :id => task.period, :task_id => 4
211
211
 
212
212
  assert_equal num_tasks, Task.count
213
213
  assert_equal num_open_tasks - 1, Task.find_open.size
@@ -3,9 +3,9 @@ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
3
  require 'test_help'
4
4
  require 'user_notify'
5
5
 
6
- class Test::Unit::TestCase
6
+ class ActiveSupport::TestCase
7
7
  def self.main_scenario
8
- fixtures :parties, :users, :groups, :groups_users, :work_accounts, :backlogs, :periods, :tasks,
8
+ fixtures :parties, :users, :groups, :groups_users, :backlogs, :periods, :tasks,
9
9
  :task_files, :works, :estimates, :work_lock_subscriptions, :work_locks, :absences
10
10
  end
11
11
 
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
 
3
- class AbsenceTest < Test::Unit::TestCase
3
+ class AbsenceTest < ActiveSupport::TestCase
4
4
  main_scenario
5
5
 
6
6
  def teardown
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
 
3
- class ConfigurationTest < Test::Unit::TestCase
3
+ class ConfigurationTest < ActiveSupport::TestCase
4
4
  fixtures :configurations
5
5
 
6
6
  # Replace this with your real tests.
@@ -1,6 +1,6 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
2
 
3
- class CustomerTest < Test::Unit::TestCase
3
+ class CustomerTest < ActiveSupport::TestCase
4
4
  fixtures :customers
5
5
 
6
6
  # Replace this with your real tests.