Skip to content

Instantly share code, notes, and snippets.

@shen-sat
Created July 22, 2020 10:16
Show Gist options
  • Save shen-sat/83d94b06df152a91b9db6329f03a4284 to your computer and use it in GitHub Desktop.
Save shen-sat/83d94b06df152a91b9db6329f03a4284 to your computer and use it in GitHub Desktop.
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