Sha256: 69847ed1bdf69dc24955736dfd5ec61a97c3c9e07b0841c7cefe2f200f6acfeb

Contents?: true

Size: 710 Bytes

Versions: 7

Compression:

Stored size: 710 Bytes

Contents

require 'spec_helper'

RSpec.describe MobilizeAmericaClient::Client::Organizations do
  let(:standard_headers) { {'Content-Type' => 'application/json'} }

  subject { MobilizeAmericaClient::Client.new }

  let(:base_url) { "https://#{MobilizeAmericaClient::Client::API_DOMAIN}#{MobilizeAmericaClient::Client::API_BASE_PATH}" }

  describe '#organizations' do
    let(:organizations_url) { "#{base_url}/organizations" }
    let(:response) { fixture('organizations.json').read }

    it 'should call the endpoint and return JSON' do
      stub_request(:get, organizations_url).with(headers: standard_headers).to_return(body: response.to_json)
      expect(subject.organizations).to eq response
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mobilize-america-client-0.5.1 spec/client/organizations_spec.rb
mobilize-america-client-0.5.0 spec/client/organizations_spec.rb
mobilize-america-client-0.4.0 spec/client/organizations_spec.rb
mobilize-america-client-0.3.6 spec/client/organizations_spec.rb
mobilize-america-client-0.3.5 spec/client/organizations_spec.rb
mobilize-america-client-0.3.4 spec/client/organizations_spec.rb
mobilize-america-client-0.3.3 spec/client/organizations_spec.rb