1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove some aggregation tests related to composed_of

Since composed_of was removed in 051747449e,
these tests were working "by mistake", due to the matching "address"
string in the error message, but with a different error message than the
expected multiparameter assignment error.

Since "address" is not an attribute from Customer anymore, the error was
"undefined method klass for nil", where nil was supposed to be the
column object.
This commit is contained in:
Carlos Antonio da Silva 2012-06-28 00:45:41 -03:00
parent 100ad217b8
commit 4563995096
2 changed files with 0 additions and 21 deletions

View file

@ -907,26 +907,6 @@ class BasicsTest < ActiveRecord::TestCase
end
end
def test_multiparameter_assignment_of_aggregation_with_missing_values
ex = assert_raise(ActiveRecord::MultiparameterAssignmentErrors) do
customer = Customer.new
address = Address.new("The Street", "The City", "The Country")
attributes = { "address(2)" => address.city, "address(3)" => address.country }
customer.attributes = attributes
end
assert_equal("address", ex.errors[0].attribute)
end
def test_multiparameter_assignment_of_aggregation_with_large_index
ex = assert_raise(ActiveRecord::MultiparameterAssignmentErrors) do
customer = Customer.new
address = Address.new("The Street", "The City", "The Country")
attributes = { "address(1)" => "The Street", "address(2)" => address.city, "address(3000)" => address.country }
customer.attributes = attributes
end
assert_equal("address", ex.errors[0].attribute)
end
def test_attributes_on_dummy_time
# Oracle, and Sybase do not have a TIME datatype.
return true if current_adapter?(:OracleAdapter, :SybaseAdapter)

View file

@ -64,7 +64,6 @@ class AuditLog < ActiveRecord::Base
belongs_to :unvalidated_developer, :class_name => 'Developer'
end
DeveloperSalary = Struct.new(:amount)
class DeveloperWithBeforeDestroyRaise < ActiveRecord::Base
self.table_name = 'developers'
has_and_belongs_to_many :projects, :join_table => 'developers_projects', :foreign_key => 'developer_id'