Skip to content

Instantly share code, notes, and snippets.

@glesage
Last active August 29, 2015 13:57
Show Gist options
  • Save glesage/9902719 to your computer and use it in GitHub Desktop.
Save glesage/9902719 to your computer and use it in GitHub Desktop.
require 'test_helper'
class DataControllerTest < ActionController::TestCase
test "should create data" do
assert_difference('Data.count') do
post '/data', { # Same error when replaced with /datum
name: 'my_name',
},
{
HTTP_CONTENT_TYPE: 'application/json',
HTTP_ACCEPT: 'application/vnd.api-test+json; version=1'
}
end
assert_response 201
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment