Sha256: 98e84093d5617a29bab4595c6be765fd260ff2bab48269f8d6e7bad0134127b1

Contents?: true

Size: 482 Bytes

Versions: 1

Compression:

Stored size: 482 Bytes

Contents

require_relative "../lib/mapitpostcode"
require "rspec"
require "webmock/rspec"

describe "Fetching a postcode" do
   before(:each) do
     stub_request(:get, "http://mapit.mysociety.org/postcode/w36jd").to_return(:body => IO.read("spec/fixtures/resp.json"))
   end

   it "returns a hash" do
     response = MapitPostcode.get("W3 6JD")
     WebMock.should have_requested(:get, "http://mapit.mysociety.org/postcode/w36jd")
     expect(response["easting"]).to eq(520328)
   end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mapitpostcode-0.0.1 spec/mapitpostcode_spec.rb