Sha256: a962a73e6a78586fb7cd824ca3958bd74b4bc5d427fd1ad0405bac2d5abe31b4

Contents?: true

Size: 834 Bytes

Versions: 3

Compression:

Stored size: 834 Bytes

Contents

require 'spec_helper'

module Mrt::Ingest
  describe Client do
    describe :new do
      it 'creates a client' do
        client = Client.new('http://example.org/ingest')
        expect(client).to be_a(Client)
      end

      it 'accepts credentials' do
        client = Client.new('http://example.org/ingest', 'me', 'secret')
        expect(client).to be_a(Client)
      end
    end

    describe :mk_request do
      before(:each) do
        @client = Client.new('http://example.org/ingest', 'me', 'secret')
        @iobject = IObject.new
        @ingest_req = @iobject.mk_request('profile', 'submitter')
      end

      it 'creates a valid request' do
        rest_req = @client.mk_rest_request(@ingest_req)
        expect(rest_req.user).to eq('me')
        expect(rest_req.password).to eq('secret')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mrt-ingest-0.0.10 spec/unit/mrt/ingest/client_spec.rb
mrt-ingest-0.0.6 spec/unit/mrt/ingest/client_spec.rb
mrt-ingest-0.0.5 spec/unit/mrt/ingest/client_spec.rb