active_model_serializers-matchers
active_model_serializers-matchers copied to clipboard
Update to work with latest version of the gem
Some minor changes to how associations are tested, and allow specification of attribute aliases, e.g.
it "should match attributes with keys" do
serializer = Class.new ActiveModel::Serializer do
attribute :foo, :key => :foo_name
end
serializer.should_not have_attribute :bar
serializer.should have_attribute :foo
serializer.should have_attribute(:foo).as(:foo_name)
serializer.should_not have_attribute(:foo).as(:another_name)
end