summaryrefslogtreecommitdiff
path: root/spec/features/issues
diff options
context:
space:
mode:
authorJan <king-jan1999@hotmail.de>2018-06-13 12:42:36 +0000
committerRémy Coutable <remy@rymai.me>2018-06-13 12:42:36 +0000
commit5ba9279c5039615fd797beab273f3c1aeb642dd0 (patch)
tree7a8ccb1e15d496c981331b64f6e5165a04bb8ab8 /spec/features/issues
parent031ee142b1cd941eb10afd11db553173a60428f3 (diff)
downloadgitlab-ce-5ba9279c5039615fd797beab273f3c1aeb642dd0.tar.gz
Resolve "Add `/confidential` quick action for issues"
Diffstat (limited to 'spec/features/issues')
-rw-r--r--spec/features/issues/user_uses_slash_commands_spec.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb
index fd0aa6cf3a3..dacca494755 100644
--- a/spec/features/issues/user_uses_slash_commands_spec.rb
+++ b/spec/features/issues/user_uses_slash_commands_spec.rb
@@ -153,6 +153,42 @@ feature 'Issues > User uses quick actions', :js do
end
end
+ describe 'make issue confidential' do
+ let(:issue) { create(:issue, project: project) }
+ let(:original_issue) { create(:issue, project: project) }
+
+ context 'when the current user can update issues' do
+ it 'does not create a note, and marks the issue as confidential' do
+ add_note("/confidential")
+
+ expect(page).not_to have_content "/confidential"
+ expect(page).to have_content 'Commands applied'
+ expect(page).to have_content "made the issue confidential"
+
+ expect(issue.reload).to be_confidential
+ end
+ end
+
+ context 'when the current user cannot update the issue' do
+ let(:guest) { create(:user) }
+ before do
+ project.add_guest(guest)
+ gitlab_sign_out
+ sign_in(guest)
+ visit project_issue_path(project, issue)
+ end
+
+ it 'does not create a note, and does not mark the issue as confidential' do
+ add_note("/confidential")
+
+ expect(page).not_to have_content 'Commands applied'
+ expect(page).not_to have_content "made the issue confidential"
+
+ expect(issue.reload).not_to be_confidential
+ end
+ end
+ end
+
describe 'move the issue to another project' do
let(:issue) { create(:issue, project: project) }