Skip to content

Instantly share code, notes, and snippets.

@shen-sat
Created July 22, 2020 10:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
describe 'PUT #update' do
let!(:user) { create(:user_complete_profile) }
let(:params) { { user: { id: user.id, email: 'changed@gmail.com' } } }
before do
sign_in user
session[:return_to] = projects_path
end
it 'we should be on projects path' do
put :update, params: params
user.reload
expect(user.email).to eq('changed@gmail.com')
expect(response).to redirect_to projects_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment