Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. require File.dirname(__FILE__) '/../test_helper'
  2.  
  3. context "A user" do
  4. specify "should be able to be created" do
  5. user = create_user
  6. user.should.not.be.nil
  7. user.errors.should.be.empty
  8. end
  9.  
  10. context "should not be created" do
  11. setup { @old_count = User.count }
  12. teardown { User.count.should.equal @old_count }
  13.  
  14. specify "if password_confirmation doesn't match password" do
  15. user = create_user(:password => 'foo', :password_confirmation => 'bar')
  16. user.errors.on(:password).should.match /confirmation/
  17. end
  18. end
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement