Skip to content

Instantly share code, notes, and snippets.

@ericchen
Created May 13, 2011 06:49
Show Gist options
  • Save ericchen/970096 to your computer and use it in GitHub Desktop.
Save ericchen/970096 to your computer and use it in GitHub Desktop.
rspec test
it "should not update email" do
lambda {
post :profile, {:user => {:email=>'', :first_name => 'jacky'}}
@user.reload
}.should_not change(@user, :email)
end
it "should update first name" do
expect {
post :profile, {:user => {:email=>'', :first_name => 'jacky'}}
@user.reload
}.to change(@user, :first_name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment