mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
f8e91bda9c
Allows separate models that include ActiveModel::AttributeMethods to use different sets of attribute matchers. Signed-off-by: Joshua Peek <josh@joshpeek.com>
20 lines
520 B
Ruby
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
|