Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ module Idv
module InPerson
module Public
class UspsLocationsController < ApplicationController
include RenderConditionConcern

check_or_render_not_found -> { enabled? }

skip_forgery_protection

def index
Expand Down Expand Up @@ -38,10 +34,6 @@ def localized_locations(locations)
end
end

def enabled?
IdentityConfig.store.in_person_public_address_search_enabled
end

def search_params
params.require(:address).permit(
:street_address,
Expand Down
4 changes: 1 addition & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,7 @@ class Application < Rails::Application
allow do
origins IdentityCors.allowed_origins_static_sites
resource '/api/country-support', headers: :any, methods: [:get]
if Identity::Hostdata.config.in_person_public_address_search_enabled
resource '/api/usps_locations', headers: :any, methods: %i[post options]
end
resource '/api/usps_locations', headers: :any, methods: %i[post options]
end
end

Expand Down
1 change: 0 additions & 1 deletion config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ in_person_outage_message_enabled: false
in_person_proofing_enabled: false
in_person_proofing_enforce_tmx: false
in_person_proofing_opt_in_enabled: false
in_person_public_address_search_enabled: false
in_person_results_delay_in_hours: 1
in_person_send_proofing_notifications_enabled: false
in_person_state_id_controller_enabled: false
Expand Down
1 change: 0 additions & 1 deletion lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ def self.store
config.add(:in_person_proofing_enabled, type: :boolean)
config.add(:in_person_proofing_enforce_tmx, type: :boolean)
config.add(:in_person_proofing_opt_in_enabled, type: :boolean)
config.add(:in_person_public_address_search_enabled, type: :boolean)
config.add(:in_person_results_delay_in_hours, type: :integer)
config.add(:in_person_send_proofing_notifications_enabled, type: :boolean)
config.add(:in_person_state_id_controller_enabled, type: :boolean)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,9 @@
}
end

context 'with feature flag on' do
before do
allow(IdentityConfig.store).to receive(:in_person_public_address_search_enabled).
and_return(true)
end

it 'is successful and has a response' do
action
expect(response).to be_ok
end
end

context 'with feature flag off' do
before do
allow(IdentityConfig.store).to receive(:in_person_public_address_search_enabled).
and_return(false)
end

it 'is a 400' do
action

expect(response).to be_not_found
end
it 'is successful and has a response' do
action
expect(response).to be_ok
end
end
end