You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

21 lines
855 B

require File.dirname(__FILE__) + '/../test_helper'
class UserTest < Test::Unit::TestCase
load_all_fixtures
should_have_many :posts
should_have_many :dogs
should_not_allow_values_for :email, "blah", "b lah"
should_allow_values_for :email, "a@b.com", "asdf@asdf.com"
should_ensure_length_in_range :email, 1..100
should_ensure_value_in_range :age, 1..100
should_protect_attributes :password
should_have_class_methods :find, :destroy
should_have_instance_methods :email, :age, :email=, :valid?
should_have_db_columns :name, :email, :age
should_have_db_column :id, :type => "integer", :primary => true
should_have_db_column :email, :type => "string", :default => nil, :precision => nil, :limit => 255,
:null => true, :primary => false, :scale => nil, :sql_type => 'varchar(255)'
end