Sha256: fe5927ef756b8b805059ec0d88e9f91a6f07715862665e17edc23f81c4e867b5

Contents?: true

Size: 519 Bytes

Versions: 92

Compression:

Stored size: 519 Bytes

Contents

require 'spec_helper'
require 'flydata/api_client'

module Flydata
  describe ApiClient do
    subject { described_class.instance }
    let(:resource) { double('resource') }
    let(:response) { JSON.parse('{"success":true}') }

    describe "#post" do
      it do
        expect(RestClient::Resource).to receive(:new).and_return(resource)
        expect(resource).to receive(:post).with(nil, accept: :json).and_return(response.to_json)
        expect(subject.post('/user')).to eq(response)
      end
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
flydata-0.7.13 spec/flydata/api_client_spec.rb
flydata-0.7.12 spec/flydata/api_client_spec.rb
flydata-0.7.11 spec/flydata/api_client_spec.rb
flydata-0.7.10 spec/flydata/api_client_spec.rb
flydata-0.7.9 spec/flydata/api_client_spec.rb
flydata-0.7.8 spec/flydata/api_client_spec.rb
flydata-0.7.7 spec/flydata/api_client_spec.rb
flydata-0.7.6 spec/flydata/api_client_spec.rb
flydata-0.7.5 spec/flydata/api_client_spec.rb
flydata-0.7.4 spec/flydata/api_client_spec.rb
flydata-0.7.2.1 spec/flydata/api_client_spec.rb
flydata-0.7.2 spec/flydata/api_client_spec.rb
flydata-0.7.1 spec/flydata/api_client_spec.rb
flydata-0.7.0 spec/flydata/api_client_spec.rb
flydata-0.6.14 spec/flydata/api_client_spec.rb
flydata-0.6.13 spec/flydata/api_client_spec.rb
flydata-0.6.12 spec/flydata/api_client_spec.rb
flydata-0.6.11 spec/flydata/api_client_spec.rb
flydata-0.6.10 spec/flydata/api_client_spec.rb
flydata-0.6.9 spec/flydata/api_client_spec.rb