Sha256: 38827b09841101591edb988e10bf9d359b890b2a9b1e853b5fe6addf620d8d70

Contents?: true

Size: 926 Bytes

Versions: 49

Compression:

Stored size: 926 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe LHC do
  context 'GET' do
    before do
      stub_request(:get, "http://datastore/v2/feedbacks").to_return(status: 200, body: "{}")
    end
    it "is able to call .request without LHC raising NoMethodError: undefined method `blank?' for nil:NilClass when calling it outside of the rails context" do
      expect { LHC.request(url: "http://datastore/v2/feedbacks", method: :get) }.not_to raise_error
    end
  end

  context 'POST' do
    before do
      stub_request(:post, "http://datastore/v2/feedbacks").to_return(status: 200, body: "{}")
    end

    it "is able to call .request without LHC raising NoMethodError: undefined method `deep_symbolize_keys' for {}:Hash" do
      options = {
        url: "http://datastore/v2/feedbacks",
        method: :post,
        body: {}
      }
      expect { LHC.request(options) }.not_to raise_error
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

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