Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update
- if check_token?
- @user.update(user_params)
- head :no_content
- end
- end
- describe 'PUT /users/:id' do
- let!(:user) { User.create(id: 1, email: 'test@mail.ru', password: 'abc123') }
- context '# check success update' do
- before(:each) do
- patch :update, { user: { id: 1, email: 'newmail@example.com' } }
- end
- it 'returns status code 204' do
- expect(response).to have_http_status(204)
- end
- end
- end #<-- end of PUT /users/:id
- Failures:
- 1) UsersController PUT /users/:id # check success update returns status code 204
- Failure/Error: patch :update, { user: { id: 1, email: 'newmail@example.com' } }
- ArgumentError:
- unknown keyword: user
- # ./spec/controllers/users_controller_spec.rb:37:in `block (4 levels) in <top (required)>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement