summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/email
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-08-09 20:54:18 +0200
committerRémy Coutable <remy@rymai.me>2016-08-13 00:06:12 +0200
commit39f7f63fe951ff861ad151125188e6cdd598b6ff (patch)
tree8fa991298d3be0c8537f8402f4e17a5cd5e2eb28 /spec/lib/gitlab/email
parent7cc4ab14b8a2f1d7d374a320b79374764527659f (diff)
downloadgitlab-ce-39f7f63fe951ff861ad151125188e6cdd598b6ff.tar.gz
Add the /title slash command
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/lib/gitlab/email')
-rw-r--r--spec/lib/gitlab/email/handler/create_note_handler_spec.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb
index e2339c5e103..afb072105cf 100644
--- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb
+++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb
@@ -64,10 +64,21 @@ describe Gitlab::Email::Handler::CreateNoteHandler, lib: true do
context 'because the note was commands only' do
let!(:email_raw) { fixture_file("emails/commands_only_reply.eml") }
- it 'raises a CommandsOnlyNoteError' do
- expect { receiver.execute }.not_to raise_error
+ context 'and current user cannot update noteable' do
+ it 'raises a CommandsOnlyNoteError' do
+ expect { receiver.execute }.to raise_error(Gitlab::Email::InvalidNoteError)
+ end
end
+ context 'and current user can update noteable' do
+ before do
+ project.team << [user, :developer]
+ end
+
+ it 'raises a CommandsOnlyNoteError' do
+ expect { receiver.execute }.not_to raise_error
+ end
+ end
end
end