Sha256: e76b14ae55b0c9934b5fbc0832b82df4b640d487aac484eb1bf9ad66211a2b4b

Contents?: true

Size: 876 Bytes

Versions: 13

Compression:

Stored size: 876 Bytes

Contents

require 'rails_helper'

describe LHC do
  context 'delete' do
    let(:feedback) do
      {
        recommended: true,
        source_id: 'aaa',
        content_ad_id: '1z-5r1fkaj'
      }
    end

    before(:each) do
      stub_request(:delete, "http://datastore/v2/feedbacks/12121")
        .to_return(status: 200, body: feedback.to_json, headers: { 'Content-Encoding' => 'UTF-8' })
    end

    it 'does a delete request when providing a complete url' do
      LHC.delete('http://datastore/v2/feedbacks/12121')
    end

    it 'makes response data available in a rails way' do
      response = LHC.delete('http://datastore/v2/feedbacks/12121')
      expect(response.data.recommended).to eq true
    end

    it 'provides response headers' do
      response = LHC.delete('http://datastore/v2/feedbacks/12121')
      expect(response.headers).to be_present
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lhc-10.1.2 spec/basic_methods/delete_spec.rb
lhc-10.1.1 spec/basic_methods/delete_spec.rb
lhc-10.1.0 spec/basic_methods/delete_spec.rb
lhc-10.0.2 spec/basic_methods/delete_spec.rb
lhc-9.4.4 spec/basic_methods/delete_spec.rb
lhc-10.0.1 spec/basic_methods/delete_spec.rb
lhc-10.0.0 spec/basic_methods/delete_spec.rb
lhc-9.4.3 spec/basic_methods/delete_spec.rb
lhc-9.4.2 spec/basic_methods/delete_spec.rb
lhc-9.4.1 spec/basic_methods/delete_spec.rb
lhc-9.4.0 spec/basic_methods/delete_spec.rb
lhc-9.3.1 spec/basic_methods/delete_spec.rb
lhc-9.3.0 spec/basic_methods/delete_spec.rb