diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 09:52:17 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 10:04:31 +1100 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/controllers/notification_settings_controller_spec.rb | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) | |
download | gitlab-ce-b44a2c801a64fb282cea794871fcfcf81e4ec539.tar.gz |
Update specs to rails5 formatblackst0ne-convert-specs-rails5-style
Updates specs to use new rails5 format.
The old format:
`get :show, { some: params }, { some: headers }`
The new format:
`get :show, params: { some: params }, headers: { some: headers }`
Diffstat (limited to 'spec/controllers/notification_settings_controller_spec.rb')
-rw-r--r-- | spec/controllers/notification_settings_controller_spec.rb | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/spec/controllers/notification_settings_controller_spec.rb b/spec/controllers/notification_settings_controller_spec.rb index a3356a86d4b..cf52ce834b6 100644 --- a/spec/controllers/notification_settings_controller_spec.rb +++ b/spec/controllers/notification_settings_controller_spec.rb @@ -13,8 +13,10 @@ describe NotificationSettingsController do context 'when not authorized' do it 'redirects to sign in page' do post :create, - project_id: project.id, - notification_setting: { level: :participating } + params: { + project_id: project.id, + notification_setting: { level: :participating } + } expect(response).to redirect_to(new_user_session_path) end @@ -41,8 +43,10 @@ describe NotificationSettingsController do it 'creates notification setting' do post :create, - project_id: project.id, - notification_setting: { level: :participating } + params: { + project_id: project.id, + notification_setting: { level: :participating } + } expect(response.status).to eq 200 expect(notification_setting.level).to eq("participating") @@ -54,8 +58,10 @@ describe NotificationSettingsController do context 'with custom settings' do it 'creates notification setting' do post :create, - project_id: project.id, - notification_setting: { level: :custom }.merge(custom_events) + params: { + project_id: project.id, + notification_setting: { level: :custom }.merge(custom_events) + } expect(response.status).to eq 200 expect(notification_setting.level).to eq("custom") @@ -72,8 +78,10 @@ describe NotificationSettingsController do it 'creates notification setting' do post :create, - namespace_id: group.id, - notification_setting: { level: :watch } + params: { + namespace_id: group.id, + notification_setting: { level: :watch } + } expect(response.status).to eq 200 expect(notification_setting.level).to eq("watch") @@ -85,8 +93,10 @@ describe NotificationSettingsController do context 'with custom settings' do it 'creates notification setting' do post :create, - namespace_id: group.id, - notification_setting: { level: :custom }.merge(custom_events) + params: { + namespace_id: group.id, + notification_setting: { level: :custom }.merge(custom_events) + } expect(response.status).to eq 200 expect(notification_setting.level).to eq("custom") @@ -108,8 +118,10 @@ describe NotificationSettingsController do it 'returns 404' do post :create, - project_id: private_project.id, - notification_setting: { level: :participating } + params: { + project_id: private_project.id, + notification_setting: { level: :participating } + } expect(response).to have_gitlab_http_status(404) end @@ -122,8 +134,10 @@ describe NotificationSettingsController do context 'when not authorized' do it 'redirects to sign in page' do put :update, - id: notification_setting, - notification_setting: { level: :participating } + params: { + id: notification_setting, + notification_setting: { level: :participating } + } expect(response).to redirect_to(new_user_session_path) end @@ -136,8 +150,10 @@ describe NotificationSettingsController do it 'returns success' do put :update, - id: notification_setting, - notification_setting: { level: :participating } + params: { + id: notification_setting, + notification_setting: { level: :participating } + } expect(response.status).to eq 200 end @@ -153,8 +169,10 @@ describe NotificationSettingsController do it 'returns success' do put :update, - id: notification_setting, - notification_setting: { level: :participating, events: custom_events } + params: { + id: notification_setting, + notification_setting: { level: :participating, events: custom_events } + } expect(response.status).to eq 200 end @@ -170,8 +188,10 @@ describe NotificationSettingsController do it 'returns 404' do put :update, - id: notification_setting, - notification_setting: { level: :participating } + params: { + id: notification_setting, + notification_setting: { level: :participating } + } expect(response).to have_gitlab_http_status(404) end |