diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-27 11:16:47 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-11-27 11:16:47 +0000 |
commit | 885605b439dec39b23d2043c436d03b447ad919c (patch) | |
tree | 978eab45c993b38c3f684ed19aa24913e2065394 /test | |
parent | b95fd6315c9b82eb65244b1a5b13bd1b69afe529 (diff) | |
download | redmine-885605b439dec39b23d2043c436d03b447ad919c.tar.gz redmine-885605b439dec39b23d2043c436d03b447ad919c.zip |
Resourcified attachments.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7948 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/attachments_controller_test.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/test/functional/attachments_controller_test.rb b/test/functional/attachments_controller_test.rb index bc1a5183a..42076b57e 100644 --- a/test/functional/attachments_controller_test.rb +++ b/test/functional/attachments_controller_test.rb @@ -224,7 +224,7 @@ class AttachmentsControllerTest < ActionController::TestCase @request.session[:user_id] = 2 assert_difference 'issue.attachments.count', -1 do - post :destroy, :id => 1 + delete :destroy, :id => 1 end # no referrer assert_redirected_to '/projects/ecookbook' @@ -239,7 +239,7 @@ class AttachmentsControllerTest < ActionController::TestCase def test_destroy_wiki_page_attachment @request.session[:user_id] = 2 assert_difference 'Attachment.count', -1 do - post :destroy, :id => 3 + delete :destroy, :id => 3 assert_response 302 end set_tmp_attachments_directory @@ -248,7 +248,7 @@ class AttachmentsControllerTest < ActionController::TestCase def test_destroy_project_attachment @request.session[:user_id] = 2 assert_difference 'Attachment.count', -1 do - post :destroy, :id => 8 + delete :destroy, :id => 8 assert_response 302 end set_tmp_attachments_directory @@ -257,15 +257,17 @@ class AttachmentsControllerTest < ActionController::TestCase def test_destroy_version_attachment @request.session[:user_id] = 2 assert_difference 'Attachment.count', -1 do - post :destroy, :id => 9 + delete :destroy, :id => 9 assert_response 302 end set_tmp_attachments_directory end def test_destroy_without_permission - post :destroy, :id => 3 - assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Fattachments%2Fdestroy%2F3' + assert_no_difference 'Attachment.count' do + delete :destroy, :id => 3 + end + assert_response 302 assert Attachment.find_by_id(3) set_tmp_attachments_directory end |