Skip to content

Instantly share code, notes, and snippets.

@willrust
Created December 4, 2014 06:41
Show Gist options
  • Select an option

  • Save willrust/d261e3fc39534bbd0450 to your computer and use it in GitHub Desktop.

Select an option

Save willrust/d261e3fc39534bbd0450 to your computer and use it in GitHub Desktop.
Doorkeeper Rails API integration test POST with access token and params using rspec and factory girl.
it "responds with status 201" do
post "#{url}", { user: FactoryGirl.attributes_for(:user) }, { "HTTP_AUTHORIZATION" => "Bearer #{access_token.token}" }
expect(last_response.status).to eq(201)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment