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.8.10.2 spec/flydata/api_client_spec.rb
flydata-0.8.10.1 spec/flydata/api_client_spec.rb
flydata-0.8.9.11 spec/flydata/api_client_spec.rb
flydata-0.8.10 spec/flydata/api_client_spec.rb
flydata-0.8.9 spec/flydata/api_client_spec.rb
flydata-0.8.8 spec/flydata/api_client_spec.rb
flydata-0.8.7 spec/flydata/api_client_spec.rb
flydata-0.8.6 spec/flydata/api_client_spec.rb
flydata-0.8.5 spec/flydata/api_client_spec.rb
flydata-0.8.4 spec/flydata/api_client_spec.rb
flydata-0.8.3 spec/flydata/api_client_spec.rb
flydata-0.8.2 spec/flydata/api_client_spec.rb
flydata-0.8.1 spec/flydata/api_client_spec.rb
flydata-0.8.0 spec/flydata/api_client_spec.rb
flydata-0.7.19 spec/flydata/api_client_spec.rb
flydata-0.7.18 spec/flydata/api_client_spec.rb
flydata-0.7.17 spec/flydata/api_client_spec.rb
flydata-0.7.16 spec/flydata/api_client_spec.rb
flydata-0.7.15 spec/flydata/api_client_spec.rb
flydata-0.7.14 spec/flydata/api_client_spec.rb