Sha256: 808f4a5f445264de92e9a9e209ae39eb3d1a60593281566f8857b061b03578d7

Contents?: true

Size: 522 Bytes

Versions: 3

Compression:

Stored size: 522 Bytes

Contents

require 'rails_helper'

describe LHC do

  context 'request' do

    let(:total) { 99 }

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

    it 'does a request returning a response' do
      response = LHC.request(url: 'http://datastore/v2/feedbacks', params: { has_reviews: true }, method: :get)
      expect(response.data.total).to eq total
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lhc-3.4.0 spec/basic_methods/request_spec.rb
lhc-3.3.0 spec/basic_methods/request_spec.rb
lhc-3.2.0 spec/basic_methods/request_spec.rb