Sha256: 3c2b2d4fea03f5b6244f3875bc2e4018a364f31388e32f91c3fed2b26faa7239

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents

require 'sunlight/congress'
require 'webmock/minitest'

class TestIntegrationCongress < MiniTest::Unit::TestCase
  def setup
    Sunlight::Congress.api_key = "thisismykey"
  end

  def test_legislators_by_zipcode
    stub_request(:get, "http://congress.api.sunlightfoundation.com/legislators/locate?apikey=thisismykey&zip=90210")
      .to_return(body: '{"results":[{"first_name":"Joe"}]}')

    legislators = Sunlight::Congress::Legislator.by_zipcode(90210)

    assert_equal "Joe", legislators.first.first_name
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sunlight-congress-1.1.0 test/integration/legislators_test.rb
sunlight-congress-1.0.0 test/integration/legislators_test.rb