Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname(__FILE__) + '/../test_helper'
- class UserTest < Test::Unit::TestCase
- fixtures :users
- def test_should_create_user
- # Count the users.
- assert_difference User, :count do
- # Creates an user.
- user = create_valid_user
- # Assert checks if the value is not nil or false
- assert !user.new_record?, "#{user.errors.full_messages.to_sentence}"
- end
- end
- protected
- def create_valid_user(options = {})
- User.create({ :login => 'kain', :email => 'masterkan@gmail.com', :email_confirmation => 'masterkain@gmail.com', :password => 'pass', :password_confirmation => 'pass' }.merge(options))
- end
- end
Add Comment
Please, Sign In to add comment