1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

Changed the have_db_columns matcher test to use a model name that doesn't conflict with the rest of the Shoulda suite

This commit is contained in:
Joe Ferris 2009-01-22 12:07:08 -05:00
parent e67a49ff7e
commit ef6ffc98de

View file

@ -8,13 +8,13 @@ class DatabaseMatcherTest < Test::Unit::TestCase # :nodoc:
end
should "accept an existing database column" do
build_model_class :user, :avatar_file_name => :string
assert_accepts @matcher, User.new
build_model_class :account, :avatar_file_name => :string
assert_accepts @matcher, Account.new
end
should "reject a nonexistent database column" do
build_model_class :user
assert_rejects @matcher, User.new
build_model_class :account
assert_rejects @matcher, Account.new
end
end
@ -24,18 +24,18 @@ class DatabaseMatcherTest < Test::Unit::TestCase # :nodoc:
end
should "accept an existing database column" do
build_model_class :user, :avatar_file_name => :string
assert_accepts @matcher, User.new
build_model_class :account, :avatar_file_name => :string
assert_accepts @matcher, Account.new
end
should "reject a nonexistent database column" do
build_model_class :user
assert_rejects @matcher, User.new
build_model_class :account
assert_rejects @matcher, Account.new
end
should "reject a column with the correct name but wrong type" do
build_model_class :user, :avatar_file_name => :integer
assert_rejects @matcher, User.new
build_model_class :account, :avatar_file_name => :integer
assert_rejects @matcher, Account.new
end
end