1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/test/cases/attribute_methods_test.rb
Sam Pohlenz f8e91bda9c Don't share attribute matchers between classes [#3216 state:resolved]
Allows separate models that include ActiveModel::AttributeMethods to
use different sets of attribute matchers.

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-10-07 09:07:39 -05:00

20 lines
520 B
Ruby

require 'cases/helper'
class ModelWithAttributes
include ActiveModel::AttributeMethods
attribute_method_suffix ''
end
class ModelWithAttributes2
include ActiveModel::AttributeMethods
attribute_method_suffix '_test'
end
class AttributeMethodsTest < ActiveModel::TestCase
test 'unrelated classes should not share attribute method matchers' do
assert_not_equal ModelWithAttributes.send(:attribute_method_matchers),
ModelWithAttributes2.send(:attribute_method_matchers)
end
end