diff options
author | Rémy Coutable <remy@rymai.me> | 2018-12-17 15:34:55 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-12-17 15:34:55 +0300 |
commit | c59ff995a46457fed880bbebb0f32ad0cd8961cf (patch) | |
tree | e8819b2a9eb9cdc46fea0ff5b11147010e66cc41 /spec/controllers | |
parent | 368198d8ccbca3d8bba39c2e6ff8ad559db6e2e7 (diff) | |
parent | de399c4a497a08cff956ba6ad244b01f6c5afa63 (diff) |
Merge branch 'deprecated-comparing-actioncontroller-params-hash' into 'master'
Fix deprecation: Comparing equality between ActionController::Parameters and a Hash is deprecated
See merge request gitlab-org/gitlab-ce!23855
Diffstat (limited to 'spec/controllers')
4 files changed, 6 insertions, 6 deletions
diff --git a/spec/controllers/concerns/issuable_collections_spec.rb b/spec/controllers/concerns/issuable_collections_spec.rb index f87eed6ff9f..5a3a7a15f5a 100644 --- a/spec/controllers/concerns/issuable_collections_spec.rb +++ b/spec/controllers/concerns/issuable_collections_spec.rb @@ -90,7 +90,7 @@ describe IssuableCollections do finder_options = controller.send(:finder_options) - expect(finder_options).to eq({ + expect(finder_options).to eq(ActionController::Parameters.new({ 'assignee_id' => '1', 'assignee_username' => 'user1', 'author_id' => '2', @@ -103,7 +103,7 @@ describe IssuableCollections do 'search' => 'baz', 'sort' => 'priority', 'state' => 'opened' - }) + }).permit!) end end end diff --git a/spec/controllers/profiles/preferences_controller_spec.rb b/spec/controllers/profiles/preferences_controller_spec.rb index a66b4ab0902..b580e773459 100644 --- a/spec/controllers/profiles/preferences_controller_spec.rb +++ b/spec/controllers/profiles/preferences_controller_spec.rb @@ -45,7 +45,7 @@ describe Profiles::PreferencesController do theme_id: '2' }.with_indifferent_access - expect(user).to receive(:assign_attributes).with(prefs) + expect(user).to receive(:assign_attributes).with(ActionController::Parameters.new(prefs).permit!) expect(user).to receive(:save) go params: prefs diff --git a/spec/controllers/projects/notes_controller_spec.rb b/spec/controllers/projects/notes_controller_spec.rb index d2a26068362..9a5df2aded7 100644 --- a/spec/controllers/projects/notes_controller_spec.rb +++ b/spec/controllers/projects/notes_controller_spec.rb @@ -248,13 +248,13 @@ describe Projects::NotesController do context 'when merge_request_diff_head_sha present' do before do - service_params = { + service_params = ActionController::Parameters.new({ note: 'some note', noteable_id: merge_request.id.to_s, noteable_type: 'MergeRequest', merge_request_diff_head_sha: 'sha', in_reply_to_discussion_id: nil - } + }).permit! expect(Notes::CreateService).to receive(:new).with(project, user, service_params).and_return(double(execute: true)) end diff --git a/spec/controllers/projects/pages_domains_controller_spec.rb b/spec/controllers/projects/pages_domains_controller_spec.rb index 75871eab1ab..b9cf3e9b091 100644 --- a/spec/controllers/projects/pages_domains_controller_spec.rb +++ b/spec/controllers/projects/pages_domains_controller_spec.rb @@ -78,7 +78,7 @@ describe Projects::PagesDomainsController do it 'updates the domain' do expect(pages_domain) .to receive(:update) - .with(pages_domain_params) + .with(ActionController::Parameters.new(pages_domain_params).permit!) .and_return(true) patch(:update, params) |