diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-02-07 18:02:02 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-03-01 16:34:28 +0100 |
commit | 0a31efb57768345e2b3350a493021a26b54994a3 (patch) | |
tree | 6971509949fc7024c9a431e03160068b19e6d24a /spec/controllers | |
parent | 57c068e169381565488d9430431a7202399507f0 (diff) | |
download | gitlab-ce-0a31efb57768345e2b3350a493021a26b54994a3.tar.gz |
Remove query parameters from notes polling endpoint to make caching easier
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/notes_controller_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/controllers/projects/notes_controller_spec.rb b/spec/controllers/projects/notes_controller_spec.rb index dc597202050..d80780b1d90 100644 --- a/spec/controllers/projects/notes_controller_spec.rb +++ b/spec/controllers/projects/notes_controller_spec.rb @@ -200,4 +200,31 @@ describe Projects::NotesController do end end end + + describe 'GET index' do + let(:last_fetched_at) { '1487756246' } + let(:request_params) do + { + namespace_id: project.namespace, + project_id: project, + target_type: 'issue', + target_id: issue.id + } + end + + before do + sign_in(user) + project.team << [user, :developer] + end + + it 'passes last_fetched_at from headers to NotesFinder' do + request.headers['X-Last-Fetched-At'] = last_fetched_at + + expect(NotesFinder).to receive(:new) + .with(anything, anything, hash_including(last_fetched_at: last_fetched_at)) + .and_call_original + + get :index, request_params + end + end end |