summaryrefslogtreecommitdiff
path: root/spec/policies
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-06-13 10:25:25 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-07-24 08:10:14 +0200
commit2fa22a07296223c1239bfab94654487cca222097 (patch)
treecf930855ad24ad2770a832d530e5a5ae36719825 /spec/policies
parentb92d5135d8522e1370636799d74b51f9a37d0b2f (diff)
downloadgitlab-ce-2fa22a07296223c1239bfab94654487cca222097.tar.gz
Associate Issues tab only with internal issues tracker
Diffstat (limited to 'spec/policies')
-rw-r--r--spec/policies/project_policy_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb
index ca435dd0218..4ed788af811 100644
--- a/spec/policies/project_policy_spec.rb
+++ b/spec/policies/project_policy_spec.rb
@@ -103,6 +103,30 @@ describe ProjectPolicy, models: true do
end
end
+ context 'issues feature' do
+ subject { described_class.new(owner, project) }
+
+ context 'when the feature is disabled' do
+ it 'does not include the issues permissions' do
+ project.issues_enabled = false
+ project.save!
+
+ expect_disallowed :read_issue, :create_issue, :update_issue, :admin_issue
+ end
+ end
+
+ context 'when the feature is disabled and external tracker configured' do
+ it 'does not include the issues permissions' do
+ create(:jira_service, project: project)
+
+ project.issues_enabled = false
+ project.save!
+
+ expect_disallowed :read_issue, :create_issue, :update_issue, :admin_issue
+ end
+ end
+ end
+
context 'abilities for non-public projects' do
let(:project) { create(:empty_project, namespace: owner.namespace) }