Sha256: c63dc27f14ac5c26e22e8d3b818e77d4ed17a27b4d2dd4813a307cac42265296
Contents?: true
Size: 1.12 KB
Versions: 10
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe SolidusBolt::Accounts::DetailService, :vcr, :bolt_configuration do describe '#call', vcr: true do subject(:detail) { described_class.call(access_token: access_token) } context 'with wrong access_token' do let(:access_token) { 'Bolt Access Token' } it 'gives an error' do expect{ detail }.to raise_error(SolidusBolt::ServerError, 'This action is forbidden.') end end context 'with correct access_token' do let(:access_token) { ENV['BOLT_ACCESS_TOKEN'] } it 'receives a successful response' do expect(detail).to match hash_including('profile') expect(detail).to match hash_including('addresses') expect(detail).to match hash_including('payment_methods') end end end end # This spec depends on the bolt_access_token that needs to be generated manually # and added to the environment variable BOLT_ACCESS_TOKEN. # Generate a new access token by logging into an existing user bolt account on # development environment and copying the token from the session['bolt_access_token'] key.
Version data entries
10 entries across 10 versions & 1 rubygems