Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More test coverage for hoc_canonicalized_i18n_path #19250

Merged
merged 1 commit into from Jan 4, 2018

Conversation

wjordan
Copy link
Contributor

@wjordan wjordan commented Nov 17, 2017

This old (legacy) pegasus route is still in use on our site, and has convoluted logic and low test coverage making it risky code to maintain. This PR increases the test coverage slightly to better document existing behavior and prevent regressions.

Still more work could be done to further fix up this legacy code, this is just an incremental step.

end
else
@country = hoc_detect_country
path = File.join([possible_country_or_company, possible_language, path].select {|i| !i.nil_or_empty?})
path = File.join([possible_country_or_company, possible_language, path].reject(&:nil_or_empty?))
end

country_language = HOC_COUNTRIES[@country]['default_language']
@language = @user_language || country_language || hoc_detect_language
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure hoc_detect_language is unreachable because country_language should always be present- not confident enough in this to change/remove this code though.

@wjordan wjordan merged commit af538af into staging Jan 4, 2018
@wjordan wjordan deleted the pegasus_hoc_test_coverage branch January 4, 2018 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant