##// END OF EJS Templates
Slight changes in functional tests....
Jean-Philippe Lang -
r2233:cd83f72da47f
parent child
Show More
@@ -72,7 +72,7 class AdminControllerTest < Test::Unit::TestCase
72
72
73 def test_test_email
73 def test_test_email
74 get :test_email
74 get :test_email
75 assert_redirected_to 'settings/edit'
75 assert_redirected_to '/settings/edit?tab=notifications'
76 mail = ActionMailer::Base.deliveries.last
76 mail = ActionMailer::Base.deliveries.last
77 assert_kind_of TMail::Mail, mail
77 assert_kind_of TMail::Mail, mail
78 user = User.find(1)
78 user = User.find(1)
@@ -75,7 +75,7 class AttachmentsControllerTest < Test::Unit::TestCase
75
75
76 def test_anonymous_on_private_private
76 def test_anonymous_on_private_private
77 get :download, :id => 7
77 get :download, :id => 7
78 assert_redirected_to 'account/login'
78 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2Fdownload%2F7'
79 end
79 end
80
80
81 def test_destroy_issue_attachment
81 def test_destroy_issue_attachment
@@ -120,7 +120,7 class AttachmentsControllerTest < Test::Unit::TestCase
120
120
121 def test_destroy_without_permission
121 def test_destroy_without_permission
122 post :destroy, :id => 3
122 post :destroy, :id => 3
123 assert_redirected_to '/login'
123 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2Fdestroy%2F3'
124 assert Attachment.find_by_id(3)
124 assert Attachment.find_by_id(3)
125 end
125 end
126 end
126 end
@@ -301,7 +301,7 class IssuesControllerTest < Test::Unit::TestCase
301 :priority_id => 5,
301 :priority_id => 5,
302 :estimated_hours => '',
302 :estimated_hours => '',
303 :custom_field_values => {'2' => 'Value for field 2'}}
303 :custom_field_values => {'2' => 'Value for field 2'}}
304 assert_redirected_to 'issues/show'
304 assert_redirected_to :controller => 'issues', :action => 'show'
305
305
306 issue = Issue.find_by_subject('This is the test_new issue')
306 issue = Issue.find_by_subject('This is the test_new issue')
307 assert_not_nil issue
307 assert_not_nil issue
@@ -320,7 +320,7 class IssuesControllerTest < Test::Unit::TestCase
320 :subject => 'This is the test_new issue',
320 :subject => 'This is the test_new issue',
321 :description => 'This is the description',
321 :description => 'This is the description',
322 :priority_id => 5}
322 :priority_id => 5}
323 assert_redirected_to 'issues/show'
323 assert_redirected_to :controller => 'issues', :action => 'show'
324 end
324 end
325
325
326 def test_post_new_with_required_custom_field_and_without_custom_fields_param
326 def test_post_new_with_required_custom_field_and_without_custom_fields_param
@@ -352,9 +352,10 class IssuesControllerTest < Test::Unit::TestCase
352 :priority_id => 5,
352 :priority_id => 5,
353 :watcher_user_ids => ['2', '3']}
353 :watcher_user_ids => ['2', '3']}
354 end
354 end
355 assert_redirected_to 'issues/show'
356
357 issue = Issue.find_by_subject('This is a new issue with watchers')
355 issue = Issue.find_by_subject('This is a new issue with watchers')
356 assert_not_nil issue
357 assert_redirected_to :controller => 'issues', :action => 'show', :id => issue
358
358 # Watchers added
359 # Watchers added
359 assert_equal [2, 3], issue.watcher_user_ids.sort
360 assert_equal [2, 3], issue.watcher_user_ids.sort
360 assert issue.watched_by?(User.find(3))
361 assert issue.watched_by?(User.find(3))
@@ -103,7 +103,7 class TimelogControllerTest < Test::Unit::TestCase
103 r.permissions_will_change!
103 r.permissions_will_change!
104 r.save
104 r.save
105 get :report
105 get :report
106 assert_redirected_to '/account/login'
106 assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftimelog%2Freport'
107 end
107 end
108
108
109 def test_report_all_projects_one_criteria
109 def test_report_all_projects_one_criteria
@@ -60,13 +60,13 class UsersControllerTest < Test::Unit::TestCase
60 def test_edit_membership
60 def test_edit_membership
61 post :edit_membership, :id => 2, :membership_id => 1,
61 post :edit_membership, :id => 2, :membership_id => 1,
62 :membership => { :role_id => 2}
62 :membership => { :role_id => 2}
63 assert_redirected_to 'users/edit/2'
63 assert_redirected_to '/users/edit/2?tab=memberships'
64 assert_equal 2, Member.find(1).role_id
64 assert_equal 2, Member.find(1).role_id
65 end
65 end
66
66
67 def test_destroy_membership
67 def test_destroy_membership
68 post :destroy_membership, :id => 2, :membership_id => 1
68 post :destroy_membership, :id => 2, :membership_id => 1
69 assert_redirected_to 'users/edit/2'
69 assert_redirected_to '/users/edit/2?tab=memberships'
70 assert_nil Member.find_by_id(1)
70 assert_nil Member.find_by_id(1)
71 end
71 end
72 end
72 end
@@ -52,7 +52,7 class VersionsControllerTest < Test::Unit::TestCase
52 post :edit, :id => 2,
52 post :edit, :id => 2,
53 :version => { :name => 'New version name',
53 :version => { :name => 'New version name',
54 :effective_date => Date.today.strftime("%Y-%m-%d")}
54 :effective_date => Date.today.strftime("%Y-%m-%d")}
55 assert_redirected_to 'projects/settings/ecookbook'
55 assert_redirected_to '/projects/settings/ecookbook?tab=versions'
56 version = Version.find(2)
56 version = Version.find(2)
57 assert_equal 'New version name', version.name
57 assert_equal 'New version name', version.name
58 assert_equal Date.today, version.effective_date
58 assert_equal Date.today, version.effective_date
@@ -61,7 +61,7 class VersionsControllerTest < Test::Unit::TestCase
61 def test_destroy
61 def test_destroy
62 @request.session[:user_id] = 2
62 @request.session[:user_id] = 2
63 post :destroy, :id => 3
63 post :destroy, :id => 3
64 assert_redirected_to 'projects/settings/ecookbook'
64 assert_redirected_to '/projects/settings/ecookbook?tab=versions'
65 assert_nil Version.find_by_id(3)
65 assert_nil Version.find_by_id(3)
66 end
66 end
67
67
@@ -210,7 +210,7 class WikiControllerTest < Test::Unit::TestCase
210 assert page.protected?
210 assert page.protected?
211 @request.session[:user_id] = 2
211 @request.session[:user_id] = 2
212 post :protect, :id => 1, :page => page.title, :protected => '0'
212 post :protect, :id => 1, :page => page.title, :protected => '0'
213 assert_redirected_to 'wiki/ecookbook'
213 assert_redirected_to '/wiki/ecookbook/CookBook_documentation'
214 assert !page.reload.protected?
214 assert !page.reload.protected?
215 end
215 end
216
216
@@ -44,7 +44,7 class WikisControllerTest < Test::Unit::TestCase
44 def test_destroy
44 def test_destroy
45 @request.session[:user_id] = 1
45 @request.session[:user_id] = 1
46 post :destroy, :id => 1, :confirm => 1
46 post :destroy, :id => 1, :confirm => 1
47 assert_redirected_to 'projects/settings/ecookbook'
47 assert_redirected_to '/projects/settings/ecookbook?tab=wiki'
48 assert_nil Project.find(1).wiki
48 assert_nil Project.find(1).wiki
49 end
49 end
50
50
@@ -68,7 +68,7 class WorkflowsControllerTest < Test::Unit::TestCase
68
68
69 def test_post_edit
69 def test_post_edit
70 post :edit, :role_id => 2, :tracker_id => 1, :issue_status => {'4' => ['5'], '3' => ['1', '2']}
70 post :edit, :role_id => 2, :tracker_id => 1, :issue_status => {'4' => ['5'], '3' => ['1', '2']}
71 assert_redirected_to 'workflows/edit'
71 assert_redirected_to '/workflows/edit?role_id=2&tracker_id=1'
72
72
73 assert_equal 3, Workflow.count(:conditions => {:tracker_id => 1, :role_id => 2})
73 assert_equal 3, Workflow.count(:conditions => {:tracker_id => 1, :role_id => 2})
74 assert_not_nil Workflow.find(:first, :conditions => {:role_id => 2, :tracker_id => 1, :old_status_id => 3, :new_status_id => 2})
74 assert_not_nil Workflow.find(:first, :conditions => {:role_id => 2, :tracker_id => 1, :old_status_id => 3, :new_status_id => 2})
General Comments 0
You need to be logged in to leave comments. Login now