diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-09-28 14:51:08 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-09-28 14:51:08 +0000 |
commit | 7e7ac5340a281ed767066af0b5f4dd45a3d7076f (patch) | |
tree | 891640b0548c0d3063daddb219006d120fa312c3 /test/integration/issues_test.rb | |
parent | 9a7fb0ad7be0ee3403f5b89eb0c16b68c991d519 (diff) | |
download | redmine-7e7ac5340a281ed767066af0b5f4dd45a3d7076f.tar.gz redmine-7e7ac5340a281ed767066af0b5f4dd45a3d7076f.zip |
Adds buit-in groups to give specific permissions to anonymous and non members users per project (#17976).
git-svn-id: http://svn.redmine.org/redmine/trunk@13417 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/issues_test.rb')
-rw-r--r-- | test/integration/issues_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/integration/issues_test.rb b/test/integration/issues_test.rb index 196f16f5b..21faaa93f 100644 --- a/test/integration/issues_test.rb +++ b/test/integration/issues_test.rb @@ -65,6 +65,27 @@ class IssuesTest < ActionController::IntegrationTest assert_equal 1, issue.status.id end + def test_create_issue_by_anonymous_without_permission_should_fail + Role.anonymous.remove_permission! :add_issues + + assert_no_difference 'Issue.count' do + post 'projects/1/issues', :tracker_id => "1", :issue => {:subject => "new test issue"} + end + assert_response 302 + end + + def test_create_issue_by_anonymous_with_custom_permission_should_succeed + Role.anonymous.remove_permission! :add_issues + Member.create!(:project_id => 1, :principal => Group.anonymous, :role_ids => [3]) + + assert_difference 'Issue.count' do + post 'projects/1/issues', :tracker_id => "1", :issue => {:subject => "new test issue"} + end + assert_response 302 + issue = Issue.order("id DESC").first + assert_equal User.anonymous, issue.author + end + # add then remove 2 attachments to an issue def test_issue_attachments log_user('jsmith', 'jsmith') |