test/test_model.rb in couchbase-model-0.4.1 vs test/test_model.rb in couchbase-model-0.4.3
- old
+ new
@@ -169,6 +169,16 @@
assoc = beer.brewery
assert_instance_of Brewery, assoc
assert_equal "Anheuser-Busch", assoc.name
end
+ def test_to_key
+ assert_equal ["the-id"], Post.new(:id => "the-id").to_key
+ assert_equal ["the-key"], Post.new(:key => "the-key").to_key
+ end
+
+ def test_to_param
+ assert_equal "the-id", Post.new(:id => "the-id").to_param
+ assert_equal "the-key", Post.new(:key => ["the", "key"]).to_param
+ end
+
end