Skip to content

Instantly share code, notes, and snippets.

View webhive's full-sized avatar

Roman Tataurov webhive

View GitHub Profile
@webhive
webhive / rspec_rails_cheetsheet.rb
Created August 8, 2018 09:15 — forked from mlr/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet with expect syntax (including capybara matchers)
# Model
expect(@user).to have(1).error_on(:username) # checks whether there is an error in username
expect(@user.errors[:username]).to include("can't be blank") # check for the error message
# Rendering
expect(response).to render_template(:index)
# Redirecting