summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-09 16:11:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-02-09 16:11:18 +0000
commit43a6f312edde2399c9c986ed61b1e9b0e1066db6 (patch)
tree35c765cab413a9099ef45aa5c1ca830c3d736d26 /test
parent6d109258c909f71edc3a4b43843c296acf66aad0 (diff)
downloadredmine-43a6f312edde2399c9c986ed61b1e9b0e1066db6.tar.gz
redmine-43a6f312edde2399c9c986ed61b1e9b0e1066db6.zip
Merged IssuesController #edit and #update into a single actions.
Users with 'edit issues' permission can now update any property including custom fields when adding a note or changing the status (#519, #581, #587). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1129 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/issues_controller_test.rb27
-rw-r--r--test/integration/issues_test.rb2
2 files changed, 11 insertions, 18 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index f4c99f1ed..6fdbb0341 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -217,18 +217,11 @@ class IssuesControllerTest < Test::Unit::TestCase
assert mail.body.include?("Subject changed from #{old_subject} to #{new_subject}")
end
- def test_get_update
- @request.session[:user_id] = 2
- get :update, :id => 1
- assert_response :success
- assert_template 'update'
- end
-
- def test_update_with_status_and_assignee_change
+ def test_post_edit_with_status_and_assignee_change
issue = Issue.find(1)
assert_equal 1, issue.status_id
@request.session[:user_id] = 2
- post :update,
+ post :edit,
:id => 1,
:issue => { :status_id => 2, :assigned_to_id => 3 },
:notes => 'Assigned to dlopper'
@@ -243,10 +236,10 @@ class IssuesControllerTest < Test::Unit::TestCase
assert mail.body.include?("Status changed from New to Assigned")
end
- def test_update_with_note_only
+ def test_post_edit_with_note_only
notes = 'Note added by IssuesControllerTest#test_update_with_note_only'
# anonymous user
- post :update,
+ post :edit,
:id => 1,
:notes => notes
assert_redirected_to 'issues/show/1'
@@ -259,10 +252,10 @@ class IssuesControllerTest < Test::Unit::TestCase
assert mail.body.include?(notes)
end
- def test_update_with_note_and_spent_time
+ def test_post_edit_with_note_and_spent_time
@request.session[:user_id] = 2
spent_hours_before = Issue.find(1).spent_hours
- post :update,
+ post :edit,
:id => 1,
:notes => '2.5 hours added',
:time_entry => { :hours => '2.5', :comments => '', :activity_id => Enumeration.get_values('ACTI').first }
@@ -280,9 +273,9 @@ class IssuesControllerTest < Test::Unit::TestCase
assert_equal spent_hours_before + 2.5, issue.spent_hours
end
- def test_update_with_attachment_only
+ def test_post_edit_with_attachment_only
# anonymous user
- post :update,
+ post :edit,
:id => 1,
:notes => '',
:attachments => [ test_uploaded_file('testfile.txt', 'text/plain') ]
@@ -297,12 +290,12 @@ class IssuesControllerTest < Test::Unit::TestCase
assert mail.body.include?('testfile.txt')
end
- def test_update_with_no_change
+ def test_post_edit_with_no_change
issue = Issue.find(1)
issue.journals.clear
ActionMailer::Base.deliveries.clear
- post :update,
+ post :edit,
:id => 1,
:notes => ''
assert_redirected_to 'issues/show/1'
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb
index 7249ed3da..eda4ef676 100644
--- a/test/integration/issues_test.rb
+++ b/test/integration/issues_test.rb
@@ -48,7 +48,7 @@ class IssuesTest < ActionController::IntegrationTest
def test_issue_attachements
log_user('jsmith', 'jsmith')
- post 'issues/update/1',
+ post 'issues/edit/1',
:notes => 'Some notes',
:attachments => ([] << ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/testfile.txt', 'text/plain'))
assert_redirected_to "issues/show/1"