Last active
August 29, 2015 14:27
-
-
Save narkai/c0a75d4e729a10fab928 to your computer and use it in GitHub Desktop.
json api request spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
describe "users", :type => :request do | |
describe 'users#create' do | |
context "when is successfully created" do | |
before(:each) do | |
params = { | |
data: { | |
type: "users", | |
attributes: { | |
name: "rian", | |
email: "[email protected]", | |
password: "rody" | |
} | |
} | |
} | |
headers = { | |
'Content-Type' => "application/vnd.api+json", | |
'Accept' => "application/vnd.api+json" | |
} | |
# post api_v1_users_path, params, headers | |
post "/api/v1/users", params, headers | |
end | |
it "responds with 200" do | |
p response | |
# expect(response).to be_success | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍