Sha256: 9a44c5531cf496bdd2e3b52c488642bdecb21424a1f664c376c3f9ffd09f5b48

Contents?: true

Size: 621 Bytes

Versions: 2

Compression:

Stored size: 621 Bytes

Contents

require 'spec_helper'

describe GovDelivery::TMS::Keywords do
  context "loading keywords" do
    let(:client) do
      double('client')
    end
    before do
      @keywords = GovDelivery::TMS::Keywords.new(client, '/keywords')
    end
    it 'should GET ok' do
      body = [
        {"name"=>"services", "_links"=>{"self"=>"/keywords/1"}},
        {"name"=>"subscribe", "_links"=>{"self"=>"/keywords/2"}}
      ]
      expect(@keywords.client).to receive(:get).and_return(double('response', body: body, status: 200, headers: {}))
      @keywords.get
      expect(@keywords.collection.length).to eq(2)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govdelivery-tms-0.8.2 spec/keywords_spec.rb
govdelivery-tms-0.8.1 spec/keywords_spec.rb