Sha256: db7a7e3beaf2003b05554e7801d11974e0744a13ba8eaa1a9597669a63e3b3cd

Contents?: true

Size: 907 Bytes

Versions: 49

Compression:

Stored size: 907 Bytes

Contents

# frozen_string_literal: true

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

49 entries across 49 versions & 1 rubygems

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