Merge branch 'master' into glitch-soc/merge-upstream

This commit is contained in:
Thibaut Girka
2018-10-05 21:48:25 +02:00
6 changed files with 49 additions and 11 deletions

View File

@ -42,6 +42,7 @@ describe LanguageDetector do
describe 'detect' do
let(:account_without_user_locale) { Fabricate(:user, locale: nil).account }
let(:account_remote) { Fabricate(:account, domain: 'joinmastodon.org') }
it 'detects english language for basic strings' do
strings = [
@ -104,6 +105,15 @@ describe LanguageDetector do
end
end
describe 'remote user' do
it 'nil for foreign user when language is not present' do
string = '안녕하세요'
result = described_class.instance.detect(string, account_remote)
expect(result).to eq nil
end
end
describe 'with a non-`en` default locale' do
around(:each) do |example|
before = I18n.default_locale