Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

have_db_column matcher done

  • Loading branch information...
commit d261e12e36e780d284c8329ea06a90a17958e0da 1 parent da5a4f7
@croaky croaky authored jferris committed
View
6 lib/shoulda/active_record/macros.rb
@@ -412,13 +412,11 @@ def should_have_instance_methods(*methods)
# Ensure that the given columns are defined on the models backing SQL table.
# Also aliased to should_have_index for readability.
# Takes the same options available in migrations:
- # :type, :precision, :limit, :default, :null, :scale, and :sql_type
+ # :type, :precision, :limit, :default, :null, and :scale
#
# should_have_db_columns :id, :email, :name, :created_at
#
- # should_have_db_column :email, :type => "string",
- # :limit => 255,
- # :sql_type => 'varchar(255)'
+ # should_have_db_column :email, :type => "string", :limit => 255
# should_have_db_column :salary, :decimal, :precision => 15, :scale => 2
# should_have_db_column :admin, :default => false, :null => false
#
View
2  test/matchers/have_db_column_matcher_test.rb
@@ -166,6 +166,4 @@ class HaveDbColumnMatcherTest < Test::Unit::TestCase # :nodoc:
end
end
- # :sql_type
-
end
View
2  test/unit/user_test.rb
@@ -45,7 +45,7 @@ class UserTest < Test::Unit::TestCase
should_have_db_columns :name, :email, :age
should_have_db_column :id, :type => "integer"
should_have_db_column :email, :type => "string", :default => nil, :precision => nil, :limit => 255,
- :null => true, :scale => nil, :sql_type => 'varchar(255)'
+ :null => true, :scale => nil
should_require_acceptance_of :eula
should_require_unique_attributes :email, :scoped_to => :name, :case_sensitive => false
Please sign in to comment.
Something went wrong with that request. Please try again.