diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/controllers/snippets | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/controllers/snippets')
-rw-r--r-- | spec/controllers/snippets/notes_controller_spec.rb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/spec/controllers/snippets/notes_controller_spec.rb b/spec/controllers/snippets/notes_controller_spec.rb index 558e68fbb8f..8e85e283b31 100644 --- a/spec/controllers/snippets/notes_controller_spec.rb +++ b/spec/controllers/snippets/notes_controller_spec.rb @@ -142,9 +142,12 @@ RSpec.describe Snippets::NotesController do expect { post :create, params: request_params }.to change { Note.count }.by(1) end - it_behaves_like 'request exceeding rate limit', :clean_gitlab_redis_cache do - let(:params) { request_params } - let(:request_full_path) { snippet_notes_path(public_snippet) } + it_behaves_like 'create notes request exceeding rate limit', :clean_gitlab_redis_cache do + let(:current_user) { user } + + def request + post :create, params: request_params + end end end @@ -170,9 +173,12 @@ RSpec.describe Snippets::NotesController do expect { post :create, params: request_params }.to change { Note.count }.by(1) end - it_behaves_like 'request exceeding rate limit', :clean_gitlab_redis_cache do - let(:params) { request_params } - let(:request_full_path) { snippet_notes_path(internal_snippet) } + it_behaves_like 'create notes request exceeding rate limit', :clean_gitlab_redis_cache do + let(:current_user) { user } + + def request + post :create, params: request_params + end end end @@ -239,10 +245,12 @@ RSpec.describe Snippets::NotesController do expect { post :create, params: request_params }.to change { Note.count }.by(1) end - it_behaves_like 'request exceeding rate limit', :clean_gitlab_redis_cache do - let(:params) { request_params } - let(:request_full_path) { snippet_notes_path(private_snippet) } - let(:user) { private_snippet.author } + it_behaves_like 'create notes request exceeding rate limit', :clean_gitlab_redis_cache do + let(:current_user) { private_snippet.author } + + def request + post :create, params: request_params + end end end end |