Skip to content

Instantly share code, notes, and snippets.

@andriy-baran
Last active April 26, 2018 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andriy-baran/274817c72b94e1db853747322f5e2057 to your computer and use it in GitHub Desktop.
Save andriy-baran/274817c72b94e1db853747322f5e2057 to your computer and use it in GitHub Desktop.
RSpec.shared_context 'api session', shared_context: :metadata do
let(:domain) { 'good.co' }
let(:email) { "#{SecureRandom.hex}@#{domain}" }
let(:user) { FactoryBot.create(:user, email: email) }
let(:valid_headers) { {} }
let(:valid_headers) do
{
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-API-Token' => user.api_key
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment