spec/model_spec.rb in cistern-0.11.0 vs spec/model_spec.rb in cistern-0.11.1
- old
+ new
@@ -57,17 +57,22 @@
attribute :same_alias_2, aliases: "nested"
attribute :same_alias_squashed_1, squash: ["nested", "attr_1"]
attribute :same_alias_squashed_2, squash: ["nested", "attr_2"]
attribute :same_alias_squashed_3, squash: ["nested", "attr_2"]
+ attribute :adam_attributes, aliases: "attributes"
def save
requires :flag
end
end
it "should parse string" do
expect(TypeSpec.new(name: 1).name).to eq("1")
+ end
+
+ it "should handle a 'attributes' aliased attribute" do
+ expect(TypeSpec.new(attributes: "x").adam_attributes).to eq("x")
end
it "should parse time" do
time = Time.now
created_at = TypeSpec.new(created_at: time.to_s).created_at