about summary refs log tree commit diff
path: root/spec/services
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-09-16 21:59:41 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-09-16 14:59:41 +0200
commit48d77ea1ebd6096a6ad5e265d99fa20e7a965276 (patch)
tree3ca87dd3a5a77b5b7e7791c77c1cfa33c9a4059e /spec/services
parentefec5072304217019bd401c2202c6eb61019db89 (diff)
Fix filterable_languages method of SettingsHelper (#4966)
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/post_status_service_spec.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/spec/services/post_status_service_spec.rb b/spec/services/post_status_service_spec.rb
index 4182c4e1f..91902ff69 100644
--- a/spec/services/post_status_service_spec.rb
+++ b/spec/services/post_status_service_spec.rb
@@ -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