Sha256: 00f9e6f2f1c5b1beae5f9a58ba3047b251d4122af2543a07592b67c1c32c55ae
Contents?: true
Size: 923 Bytes
Versions: 22
Compression:
Stored size: 923 Bytes
Contents
# frozen_string_literal: true require 'rails_helper' describe LHC::Auth do before(:each) do LHC.config.interceptors = [LHC::Auth] end it 'adds body authentication to the existing request body' do stub_request(:post, "http://local.ch/") .with(body: { message: 'body', userToken: 'dheur5hrk3' }.to_json) LHC.post('http://local.ch', auth: { body: { userToken: 'dheur5hrk3' } }, body: { message: 'body' }) end it 'adds body authentication to an empty request body' do stub_request(:post, "http://local.ch/") .with(body: { userToken: 'dheur5hrk3' }.to_json) LHC.post('http://local.ch', auth: { body: { userToken: 'dheur5hrk3' } }) end it 'adds nothing if request method is GET' do stub_request(:get, "http://local.ch/") LHC.get('http://local.ch', auth: { body: { userToken: 'dheur5hrk3' } }) end end
Version data entries
22 entries across 22 versions & 1 rubygems