Sha256: d5a4314879f44df190b84730f95717b550d43b319bb32e7afbce1779ae528549

Contents?: true

Size: 700 Bytes

Versions: 29

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHC do
  include ActionDispatch::TestProcess

  context 'form' do
    it 'formats requests to be application/x-www-form-urlencoded' do
      stub = stub_request(:post, 'http://local.ch/')
        .with(body: 'client_id=1234&client_secret=4567&grant_type=client_credentials')
        .with(headers: { 'Content-Type': 'application/x-www-form-urlencoded' })
        .to_return(status: 200)

      LHC.form.post(
        'http://local.ch',
        body: {
          client_id: '1234',
          client_secret: '4567',
          grant_type: 'client_credentials'
        }
      )

      expect(stub).to have_been_requested
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lhc-15.2.1 spec/formats/form_spec.rb
lhc-15.2.0 spec/formats/form_spec.rb
lhc-15.1.3 spec/formats/form_spec.rb
lhc-15.1.2 spec/formats/form_spec.rb
lhc-15.1.1 spec/formats/form_spec.rb
lhc-15.1.0 spec/formats/form_spec.rb
lhc-16.0.0.pre.pro2162.2 spec/formats/form_spec.rb
lhc-16.0.0.pre.pro2162 spec/formats/form_spec.rb
lhc-15.0.1 spec/formats/form_spec.rb
lhc-15.0.0 spec/formats/form_spec.rb
lhc-14.0.0 spec/formats/form_spec.rb
lhc-13.4.0.pre.pro1766.1 spec/formats/form_spec.rb
lhc-13.2.0 spec/formats/form_spec.rb
lhc-13.1.0 spec/formats/form_spec.rb
lhc-13.0.0 spec/formats/form_spec.rb
lhc-12.3.0 spec/formats/form_spec.rb
lhc-12.2.1 spec/formats/form_spec.rb
lhc-12.2.0 spec/formats/form_spec.rb
lhc-12.1.3 spec/formats/form_spec.rb
lhc-12.1.2 spec/formats/form_spec.rb