Browse Source
* Infer la from postcode * Fix other tests and lint * Add routing based on inferred la * reset la to inferred false * Use postcodes io gem * reset values if la cannot be inferred * Fix testspull/166/head
kosiakkatrina
3 years ago
committed by
GitHub
25 changed files with 207 additions and 13 deletions
@ -0,0 +1,7 @@ |
|||||||
|
class AddIsLaInferred < ActiveRecord::Migration[6.1] |
||||||
|
def change |
||||||
|
change_table :case_logs, bulk: true do |t| |
||||||
|
t.column :is_la_inferred, :boolean |
||||||
|
end |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,9 @@ |
|||||||
|
require "webmock/rspec" |
||||||
|
|
||||||
|
module RequestHelper |
||||||
|
def self.stub_http_requests |
||||||
|
WebMock.disable_net_connect!(allow_localhost: true) |
||||||
|
WebMock.stub_request(:get, /api.postcodes.io/) |
||||||
|
.to_return(status: 200, body: "{\"status\":404,\"error\":\"Postcode not found\"}", headers: {}) |
||||||
|
end |
||||||
|
end |
Loading…
Reference in new issue