diff options
author | Rémy Coutable <remy@rymai.me> | 2016-08-09 20:54:18 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-08-13 00:06:12 +0200 |
commit | 39f7f63fe951ff861ad151125188e6cdd598b6ff (patch) | |
tree | 8fa991298d3be0c8537f8402f4e17a5cd5e2eb28 /spec/lib/gitlab | |
parent | 7cc4ab14b8a2f1d7d374a320b79374764527659f (diff) | |
download | gitlab-ce-39f7f63fe951ff861ad151125188e6cdd598b6ff.tar.gz |
Add the /title slash command
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/email/handler/create_note_handler_spec.rb | 15 |
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 |