test/twin/composition_test.rb in disposable-0.1.2 vs test/twin/composition_test.rb in disposable-0.1.3
- old
+ new
@@ -41,11 +41,12 @@
# does not write to model.
song.title.must_equal "Extraction"
requester.name.must_equal "Greg Howe"
- request.save
+ res = request.save
+ res.must_equal true
# make sure models got synced and saved.
song.id.must_equal 2
song.title.must_equal "Tease"
requester.id.must_equal 1
@@ -70,7 +71,14 @@
request.save do |hash|
nested_hash = hash
end
nested_hash.must_equal(:song=>{"title"=>"Tease", "id"=>2}, :requester=>{"name"=>"Wooten", "id"=>1, "captcha"=>"Awesome!"})
+ end
+
+ # save with one unsaveable model.
+ #save returns result.
+ it do
+ song.instance_eval { def save; false; end }
+ request.save.must_equal false
end
end
\ No newline at end of file