about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-21 22:26:25 -0400
committerEugen <eugen@zeonfederated.com>2017-04-22 04:26:25 +0200
commit629d35e6f5d353d30661c1af7bbcc8aa6411e698 (patch)
treebbe02c15e82b7087eab38f9043ab2947607e1c5f /spec
parent67dea31b0f83eb711bbd49a7b893d04ca16c56fa (diff)
[WIP] Html lang on statuses (#2297)
* Add html lang attributes around statuses

* Remove urls from language detection
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/language_detector_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/language_detector_spec.rb b/spec/lib/language_detector_spec.rb
index 2e68ec63b..5fb19a1e7 100644
--- a/spec/lib/language_detector_spec.rb
+++ b/spec/lib/language_detector_spec.rb
@@ -23,6 +23,18 @@ describe LanguageDetector do
         expect(result).to be_nil
       end
 
+      describe 'because of a URL' do
+        it 'uses default locale when sent just a URL' do
+          string = 'http://example.com/media/2kFTgOJLXhQf0g2nKB4'
+          wl_result = WhatLanguage.new(:all).language_iso(string)
+          expect(wl_result).not_to eq :en
+
+          result = described_class.new(string).to_iso_s
+
+          expect(result).to eq :en
+        end
+      end
+
       describe 'with an account' do
         it 'uses the account locale when present' do
           user    = double(:user, locale: 'fr')