summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/roles.yml1
-rw-r--r--test/functional/wiki_controller_test.rb7
2 files changed, 8 insertions, 0 deletions
diff --git a/test/fixtures/roles.yml b/test/fixtures/roles.yml
index 74cba2706..78e0f0329 100644
--- a/test/fixtures/roles.yml
+++ b/test/fixtures/roles.yml
@@ -32,6 +32,7 @@ roles_001:
- :view_wiki_pages
- :view_wiki_edits
- :edit_wiki_pages
+ - :delete_wiki_pages_attachments
- :protect_wiki_pages
- :delete_wiki_pages
- :rename_wiki_pages
diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb
index b5325357c..053b86301 100644
--- a/test/functional/wiki_controller_test.rb
+++ b/test/functional/wiki_controller_test.rb
@@ -251,4 +251,11 @@ class WikiControllerTest < Test::Unit::TestCase
assert_response :success
assert_template 'edit'
end
+
+ def test_destroy_attachment
+ @request.session[:user_id] = 2
+ assert_difference 'Attachment.count', -1 do
+ post :destroy_attachment, :id => 1, :page => 'Page_with_an_inline_image', :attachment_id => 3
+ end
+ end
end