test/test_rest_methods.rb in myjohndeere-0.1.4 vs test/test_rest_methods.rb in myjohndeere-0.1.5
- old
+ new
@@ -49,14 +49,18 @@
assert_equal "something", organizations.etag
end
def test_build_resource_base_path
resource_path = "blah"
- assert_equal "blah", MyJohnDeere::Organization.build_resource_base_path!("blah", {})
+ path, base_resources = MyJohnDeere::Organization.build_resource_base_path!("blah", {})
+ assert_equal "blah", path
+ assert_nil base_resources
resource_path = "blah%{x_id}"
options = {x: 5, x_id: 1}
- assert_equal "blah1", MyJohnDeere::Organization.build_resource_base_path!(resource_path, options)
+ path, base_resources = MyJohnDeere::Organization.build_resource_base_path!(resource_path, options)
+ assert_equal "blah1", path
assert_equal({x: 5}, options)
+ assert_equal({x_id: 1}, base_resources)
assert_raises ArgumentError do
MyJohnDeere::Organization.build_resource_base_path!(resource_path, {})
end
end
\ No newline at end of file