Skip to content
Browse files

Correct attribute name mistake

  • Loading branch information...
1 parent 61bb52d commit ee6800a8cd80c172cc6544b9a0bc18f2d9be87f5 @jhchabran jhchabran committed Jul 20, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 spec/vintner/representer_spec.rb
View
12 spec/vintner/representer_spec.rb
@@ -47,6 +47,10 @@ class Dummy
include Vintner::Representer
property :title do
+ get do |model|
+ model.formatted_title
+ end
+
set do |model, value|
model.formatted_title = value
end
@@ -67,9 +71,15 @@ class Dummy
it "should export json" do
hash = {meta:{title:"some title"}}
- model = Struct.new(:title).new("some title")
+ model = Struct.new(:formatted_title).new("some title")
Dummy.export(model).should ==(hash.to_json)
end
+
+ it "should import json" do
+ model = Struct.new(:formatted_title)
+
+ Dummy.import(model, hash.to_json).title.should ==("some title")
+ end
end
end
end

0 comments on commit ee6800a

Please sign in to comment.
Something went wrong with that request. Please try again.