Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

ruby rspec change matcher

expect {
  click_button 'Save'
  @user.reload
}.to change { @user.name }.from('donald').to('gustav')
 .and change { @user.updated_at }.by(4)
 .and change { @user.great_field }.by_at_least(23}
 .and change { @user.encrypted_password }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #ruby #rspec #change #matcher
ADD COMMENT
Topic
Name
2+9 =