Skip to content

Instantly share code, notes, and snippets.

@tkanov
Created September 29, 2016 11:55
Show Gist options
  • Save tkanov/8eb67e97d8a3cde9725e52aed7827a56 to your computer and use it in GitHub Desktop.
Save tkanov/8eb67e97d8a3cde9725e52aed7827a56 to your computer and use it in GitHub Desktop.
def test_should_get_something
get :show, id: 1114, format: 'json'
expected = {
'something' => 'anything',
'index' => '1',
'attributes' => [
{ 'name' => 'guns', 'value' => 'roses' },
{ 'name' => 'red', 'value' => 'hot' },
{ 'name' => 'carpet', 'value' => 'sofa' },
{ 'name' => 'sys', 'value' => 'log' }
],
'where' => 'am_i',
}
assert_equal expected, JSON.parse(response.body)
assert_response :success
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment