Sha256: bc570e47164add093e6edd02ec03a59e4d507d2570959cc3a63031896a6afd4d

Contents?: true

Size: 850 Bytes

Versions: 1

Compression:

Stored size: 850 Bytes

Contents

require_relative '../spec_helper'


describe Syncano do
  describe '#connect' do
    let(:email) { 'kiszka@koza.com' }
    let(:password) { 'kiszonka' }
    let(:options) { { email: email, password: password } }
    let(:api_key) { 'kozakoza123' }

    before do
      stub_request(:post, endpoint_uri('account/auth/'))
          .with(body: options)
          .to_return(status: 200,
                    body: generate_body(id: 15, email: email, first_name: '', last_name: '', account_key: api_key))

      stub_request(:get, endpoint_uri('schema/'))
          .with(headers: { 'X-Api-Key' => api_key })
          .to_return(status: 200, body: generate_body([]))

      expect_any_instance_of(Syncano::Connection)
          .to receive(:authenticated?)
    end

    specify { expect(Syncano.connect(options)).to be_kind_of(Syncano::API) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
syncano-4.0.0.pre spec/unit/syncano_spec.rb