Skip to content

Instantly share code, notes, and snippets.

@nickboyce
Created April 10, 2012 09:29
Show Gist options
  • Save nickboyce/2349770 to your computer and use it in GitHub Desktop.
Save nickboyce/2349770 to your computer and use it in GitHub Desktop.
describe "as_json method" do
subject { artwork.to_json }
# test the root object structure
it { should have_json_type(String).at_path("artist_id") }
it { should have_json_type(Array).at_path("available_sizes") }
# test a nested object
it { should have_json_type(Object).at_path("artist") }
it { should have_json_type(String).at_path("artist/id") }
it { should have_json_type(String).at_path("artist/slug") }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment