You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/spec/support/api_authentication.rb

9 lines
375 B
Ruby

# frozen_string_literal: true
RSpec.shared_context 'with API authentication' do |oauth_scopes: '', user_fabricator: :user|
let(:user) { Fabricate(user_fabricator) }
let(:scopes) { oauth_scopes }
let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: scopes) }
let(:headers) { { 'Authorization' => "Bearer #{token.token}" } }
end