diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 01:52:17 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 02:04:31 +0300 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/controllers/profiles_controller_spec.rb | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) |
Update specs to rails5 format
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/profiles_controller_spec.rb')
-rw-r--r-- | spec/controllers/profiles_controller_spec.rb | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/spec/controllers/profiles_controller_spec.rb b/spec/controllers/profiles_controller_spec.rb index 360c536c667..11cb59aa12a 100644 --- a/spec/controllers/profiles_controller_spec.rb +++ b/spec/controllers/profiles_controller_spec.rb @@ -9,7 +9,7 @@ describe ProfilesController, :request_store do expect do post :update, - user: { password: 'hello12345', password_confirmation: 'hello12345' } + params: { user: { password: 'hello12345', password_confirmation: 'hello12345' } } end.not_to change { user.reload.encrypted_password } expect(response.status).to eq(302) @@ -21,7 +21,7 @@ describe ProfilesController, :request_store do sign_in(user) put :update, - user: { email: "john@gmail.com", name: "John" } + params: { user: { email: "john@gmail.com", name: "John" } } user.reload @@ -35,7 +35,7 @@ describe ProfilesController, :request_store do sign_in(user) put :update, - user: { email: "john@gmail.com", name: "John" } + params: { user: { email: "john@gmail.com", name: "John" } } user.reload @@ -52,7 +52,7 @@ describe ProfilesController, :request_store do sign_in(ldap_user) put :update, - user: { email: "john@gmail.com", name: "John" } + params: { user: { email: "john@gmail.com", name: "John" } } ldap_user.reload @@ -69,7 +69,7 @@ describe ProfilesController, :request_store do sign_in(ldap_user) put :update, - user: { email: "john@gmail.com", name: "John", location: "City, Country" } + params: { user: { email: "john@gmail.com", name: "John", location: "City, Country" } } ldap_user.reload @@ -82,7 +82,7 @@ describe ProfilesController, :request_store do it 'allows setting a user status' do sign_in(user) - put :update, user: { status: { message: 'Working hard!' } } + put :update, params: { user: { status: { message: 'Working hard!' } } } expect(user.reload.status.message).to eq('Working hard!') expect(response).to have_gitlab_http_status(302) @@ -98,7 +98,7 @@ describe ProfilesController, :request_store do sign_in(user) put :update_username, - user: { username: new_username } + params: { user: { username: new_username } } user.reload @@ -110,7 +110,9 @@ describe ProfilesController, :request_store do sign_in(user) put :update_username, - user: { username: new_username }, + params: { + user: { username: new_username } + }, format: :json expect(response.status).to eq(200) @@ -121,7 +123,9 @@ describe ProfilesController, :request_store do sign_in(user) put :update_username, - user: { username: 'invalid username.git' }, + params: { + user: { username: 'invalid username.git' } + }, format: :json expect(response.status).to eq(422) @@ -131,7 +135,7 @@ describe ProfilesController, :request_store do it 'raises a correct error when the username is missing' do sign_in(user) - expect { put :update_username, user: { gandalf: 'you shall not pass' } } + expect { put :update_username, params: { user: { gandalf: 'you shall not pass' } } } .to raise_error(ActionController::ParameterMissing) end @@ -142,7 +146,7 @@ describe ProfilesController, :request_store do sign_in(user) put :update_username, - user: { username: new_username } + params: { user: { username: new_username } } user.reload @@ -160,7 +164,7 @@ describe ProfilesController, :request_store do sign_in(user) put :update_username, - user: { username: new_username } + params: { user: { username: new_username } } user.reload |