Skip to content

Instantly share code, notes, and snippets.

@enricostano
Created October 9, 2012 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricostano/3858583 to your computer and use it in GitHub Desktop.
Save enricostano/3858583 to your computer and use it in GitHub Desktop.
without stub
1) UsersController if the user passes all the authorizations GET #show assigns the requested user to @user
Failure/Error: User.should_receive(:find).with("1").and_return(@user)
(<User(id: integer, email: string, encrypted_password: string, reset_password_token: string, reset_password_sent_at: datetime, remember_created_at: datetime, sign_in_count: integer, current_sign_in_at: datetime, last_sign_in_at: datetime, current_sign_in_ip: string, last_sign_in_ip: string, created_at: datetime, updated_at: datetime, phone: string, address: string, city: string, cap: string, partitaiva: string, ragionesociale: string) (class)>).find("1")
expected: 1 time
received: 2 times
# ./spec/controllers/users_controller_spec.rb:29:in `block (4 levels) in <top (required)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment