summaryrefslogtreecommitdiff
path: root/spec/policies/issue_policy_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/policies/issue_policy_spec.rb')
-rw-r--r--spec/policies/issue_policy_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/policies/issue_policy_spec.rb b/spec/policies/issue_policy_spec.rb
index b3ca37b17c2..e352b990159 100644
--- a/spec/policies/issue_policy_spec.rb
+++ b/spec/policies/issue_policy_spec.rb
@@ -104,7 +104,7 @@ RSpec.describe IssuePolicy do
end
it 'does not allow issue author to read or update confidential issue moved to an private project' do
- confidential_issue.project = build(:project, :private)
+ confidential_issue.project = create(:project, :private)
expect(permissions(author, confidential_issue)).to be_disallowed(:read_issue, :read_issue_iid, :update_issue)
end
@@ -117,7 +117,7 @@ RSpec.describe IssuePolicy do
end
it 'does not allow issue assignees to read or update confidential issue moved to an private project' do
- confidential_issue.project = build(:project, :private)
+ confidential_issue.project = create(:project, :private)
expect(permissions(assignee, confidential_issue)).to be_disallowed(:read_issue, :read_issue_iid, :update_issue)
end
@@ -188,7 +188,7 @@ RSpec.describe IssuePolicy do
context 'when issues are private' do
before do
- project.project_feature.update(issues_access_level: ProjectFeature::PRIVATE)
+ project.project_feature.update!(issues_access_level: ProjectFeature::PRIVATE)
end
let(:issue) { create(:issue, project: project, author: author) }
let(:visitor) { create(:user) }