Sha256: 3f6109a07d2732c3ef8aa6a6c8509b5c7e3f2405ebf979c80adc51af3c9f7f3a

Contents?: true

Size: 861 Bytes

Versions: 9

Compression:

Stored size: 861 Bytes

Contents

require 'spec_helper'

RSpec.describe Addresses::ZipcodesController, type: :request do
  let!(:state) { create :state }
  let!(:city) { create :city, state: state }
  let!(:neighborhood) { create :neighborhood, city: city }
  let!(:zipcode) { create :zipcode, city: city, neighborhood: neighborhood, number: '05012010' }

  describe "GET /zipcodes" do
    before { get '/addresses/zipcodes/05012010', params: { format: :json } }

    it "should return an interview" do
      json = JSON.parse(response.body)
      expect(response.status).to be(200)
      expect(json["id"]).to eq(zipcode.id)
      expect(json["street"]).to eq(zipcode.street)
      expect(json["city_id"]).to eq(city.id)
      expect(json["state_id"]).to eq(state.id)
      expect(json["neighborhood_id"]).to eq(neighborhood.id)
      expect(json["number"]).to eq('05012010')
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
addresses-1.0.11 spec/requests/zipcodes_spec.rb
addresses-1.0.9 spec/requests/zipcodes_spec.rb
addresses-1.0.8 spec/requests/zipcodes_spec.rb
addresses-1.0.7 spec/requests/zipcodes_spec.rb
addresses-1.0.6 spec/requests/zipcodes_spec.rb
addresses-1.0.5 spec/requests/zipcodes_spec.rb
addresses-1.0.4 spec/requests/zipcodes_spec.rb
addresses-1.0.3 spec/requests/zipcodes_spec.rb
addresses-1.0.2 spec/requests/zipcodes_spec.rb