0
0
Fork 0

Fix filterable_languages method of SettingsHelper (#4966)

This commit is contained in:
Akihiko Odaki 2017-09-16 21:59:41 +09:00 committed by Eugen Rochko
parent efec507230
commit 48d77ea1eb
7 changed files with 43 additions and 53 deletions

View file

@ -65,15 +65,12 @@ RSpec.describe PostStatusService do
end
it 'creates a status with a language set' do
detector = double(to_iso_s: :en)
allow(LanguageDetector).to receive(:new).and_return(detector)
account = Fabricate(:account)
text = 'test status text'
text = 'This is an English text.'
subject.call(account, text)
status = subject.call(account, text)
expect(LanguageDetector).to have_received(:new).with(text, account)
expect(status.language).to eq 'en'
end
it 'processes mentions' do