Skip to content

Instantly share code, notes, and snippets.

@anaumov
Created January 23, 2019 07:08
Show Gist options
  • Save anaumov/420204dd06182c3a100858a591780c89 to your computer and use it in GitHub Desktop.
Save anaumov/420204dd06182c3a100858a591780c89 to your computer and use it in GitHub Desktop.
let!(:user) { create :user }
before do
allow(User).to receive(:find).with(user.id).and_return(user)
end
it 'updates the user' do
expect(user).to receive(:update!).with(name: 'Alex')
post "/users/#{user.id}", params: { name: 'Alex' }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment