forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n_support_spec.rb
More file actions
36 lines (28 loc) · 819 Bytes
/
i18n_support_spec.rb
File metadata and controls
36 lines (28 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require "spec_helper"
describe "i18n" do
before do
UserRepository.stub(:setup_complete?).and_return(false)
ENV['LOCALE'] = locale
get "/"
end
context "when no locale was set" do
let(:locale) { nil }
it "should load default locale" do
I18n.locale.to_s.should eq "en"
I18n.locale.to_s.should_not eq nil
end
end
context "when locale was set" do
let(:locale) { 'en' }
it "should load default locale" do
I18n.locale.to_s.should eq "en"
I18n.t('layout.title').should eq "stringer | your rss buddy"
end
end
context "when a missing locale was set" do
let(:locale) { 'xx' }
it "should not find localization strings" do
I18n.t('layout.title', locale: ENV['LOCALE'].to_sym).should_not eq "stringer | your rss buddy"
end
end
end