From 198c13c40260a23ad0558cf4cb310331aa8ed105 Mon Sep 17 00:00:00 2001 From: "Chad W. Taylor" Date: Thu, 5 Feb 2015 08:32:55 -0800 Subject: [PATCH] Pluralize the root wrap from "song" to "songs" Refer to the jsonapi.org docs, it looks like the root wrap to be pluralized at all times. Another thing, I thought the purpose of this test is to test the use of `render json:singers` but `respond_with` is being used instead? --- test/json_api_renderer_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/json_api_renderer_test.rb b/test/json_api_renderer_test.rb index 1a804e6..6cdd6af 100644 --- a/test/json_api_renderer_test.rb +++ b/test/json_api_renderer_test.rb @@ -35,14 +35,14 @@ def index test "should render single model correctly in response to a application/vnd.api+json" do get :show, :id => "1", :format => :json_api - response.body.must_equal "{\"song\":{\"name\":\"Bumi\"},\"links\":{\"self\":{\"href\":\"//self\"}}}" + response.body.must_equal "{\"songs\":{\"name\":\"Bumi\"},\"links\":{\"self\":{\"href\":\"//self\"}}}" end test "should render collection of models correctly in response to a application/vnd.api+json" do get :index, :format => :json_api # assert_body '{"people":[{"first_name":"Chad"},{"first_name":"Fremont"}]}' - response.body.must_equal "{\"song\":[{\"name\":\"Bumi\"},{\"name\":\"Chad\"}],\"links\":{\"self\":{\"href\":\"//self\"}}}" + response.body.must_equal "{\"songs\":[{\"name\":\"Bumi\"},{\"name\":\"Chad\"}],\"links\":{\"self\":{\"href\":\"//self\"}}}" end test "should have a content_type of application/vnd.api+json for a single model" do