diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-16 18:11:06 +0300 |
---|---|---|
committer | Tiago <tiagonbotelho@hotmail.com> | 2017-11-17 13:22:50 +0300 |
commit | e049dfb52004e68ba2272979b7178613a7862550 (patch) | |
tree | 0d70403734fc660156149e978e23f7e43833ece7 /spec | |
parent | 5a488a6ae3606bc11b8685ae4375a9cf04962ad0 (diff) |
Merge branch 'dm-notes-actions-noteable-for-update' into 'master'
Make sure NotesActions#noteable returns a Noteable in the update action
Closes #40208
See merge request gitlab-org/gitlab-ce!15421
(cherry picked from commit 5fbda2af920a86e11696cae5b3397c3241f21b77)
f691010d Make sure NotesActions#noteable returns a Noteable in the update action
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/notes_controller_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/controllers/projects/notes_controller_spec.rb b/spec/controllers/projects/notes_controller_spec.rb index 5f5a789d5cc..37e9f863fc4 100644 --- a/spec/controllers/projects/notes_controller_spec.rb +++ b/spec/controllers/projects/notes_controller_spec.rb @@ -336,6 +336,29 @@ describe Projects::NotesController do end end + describe 'PUT update' do + let(:request_params) do + { + namespace_id: project.namespace, + project_id: project, + id: note, + format: :json, + note: { + note: "New comment" + } + } + end + + before do + sign_in(note.author) + project.team << [note.author, :developer] + end + + it "updates the note" do + expect { put :update, request_params }.to change { note.reload.note } + end + end + describe 'DELETE destroy' do let(:request_params) do { |