Commit 18a218b4 authored by Stan Hu's avatar Stan Hu

Merge branch 'jh-123-add-route-patch-and-modify-country' into 'master'

Add route patch for JH and modify country

See merge request gitlab-org/gitlab!65230
parents 16031ac1 f23dc096
......@@ -184,6 +184,10 @@ Rails.application.routes.draw do
resources :survey_responses, only: :index
end
Gitlab.jh do
draw :province
end
if ENV['GITLAB_CHAOS_SECRET'] || Rails.env.development? || Rails.env.test?
resource :chaos, only: [] do
get :leakmem
......
......@@ -5,6 +5,7 @@ module World
extend self
DENYLIST = ['Iran (Islamic Republic of)', 'Sudan', 'Syrian Arab Republic', 'Korea (Democratic People\'s Republic of)', 'Cuba'].freeze
JH_MARKET = ['China', 'Hong Kong', 'Macao'].freeze
def countries_for_select
strong_memoize(:countries_for_select) { all_countries.sort_by(&:name).map { |c| [c.name, c.alpha2] } }
......@@ -23,7 +24,7 @@ module World
end
def all_countries
strong_memoize(:all_countries) { ISO3166::Country.all.reject {|item| DENYLIST.include?(item.name) } }
strong_memoize(:all_countries) { ISO3166::Country.all.reject {|item| DENYLIST.include?(item.name) || JH_MARKET.include?(item.name) } }
end
def alpha3_from_alpha2(alpha2)
......
......@@ -20,6 +20,7 @@ RSpec.describe CountriesController do
resultant_countries = json_response.map {|row| row[0]}
expect(resultant_countries).not_to include(World::DENYLIST)
expect(resultant_countries).not_to include(World::JH_MARKET)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment