Sha256: 3c445aa348728098797e7deba4e7d3fc92ef2c46045e8f4f56fb7325af820bf5

Contents?: true

Size: 662 Bytes

Versions: 10

Compression:

Stored size: 662 Bytes

Contents

RSpec.describe Percy::Client::Connection do
  describe '#get' do
    it 'performs a GET request to the api_url and parses response' do
      stub_request(:get, "#{Percy.config.api_url}/test").to_return(body: {foo: true}.to_json)
      data = Percy.client.get("#{Percy.config.api_url}/test")
      expect(data).to eq({'foo' => true})
    end
  end
  describe '#post' do
    it 'performs a POST request to the api_url and parses response' do
      stub_request(:post, "#{Percy.config.api_url}/test").to_return(body: {foo: true}.to_json)
      data = Percy.client.post("#{Percy.config.api_url}/test", {})
      expect(data).to eq({'foo' => true})
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
percy-client-0.2.4 spec/lib/percy/client/connection_spec.rb
percy-client-0.2.3 spec/lib/percy/client/connection_spec.rb
percy-client-0.2.2 spec/lib/percy/client/connection_spec.rb
percy-client-0.2.1 spec/lib/percy/client/connection_spec.rb
percy-client-0.2.0 spec/lib/percy/client/connection_spec.rb
percy-client-0.1.6 spec/lib/percy/client/connection_spec.rb
percy-client-0.1.5 spec/lib/percy/client/connection_spec.rb
percy-client-0.1.4 spec/lib/percy/client/connection_spec.rb
percy-client-0.1.3 spec/lib/percy/client/connection_spec.rb
percy-client-0.1.2 spec/lib/percy/client/connection_spec.rb