localized 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/localized.gemspec +1 -1
- data/spec/lib/localized/helper_spec.rb +5 -5
- metadata +1 -1
data/localized.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'localized'
|
3
3
|
s.author = 'Paul Hepworth'
|
4
4
|
s.email = 'paul<dot>hepworth<at>peppyheppy<dot>com'
|
5
|
-
s.version = '0.0.
|
5
|
+
s.version = '0.0.2'
|
6
6
|
s.date = '2011-07-09'
|
7
7
|
s.summary = "A ruby on rails gem that provides locale setting support through the subdomain (in a box)"
|
8
8
|
s.description = "This gem allows you to set locale using a subdomain and url helper support for switching sites."
|
@@ -23,15 +23,15 @@ describe FoobarController , "locale specific routes", :type => :controller do
|
|
23
23
|
|
24
24
|
describe "sites and subdomain" do
|
25
25
|
before :each do
|
26
|
-
@request.host = "www.
|
26
|
+
@request.host = "www.mysite.test"
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should have the regular tests host" do
|
30
|
-
root_url.should == 'http://www.
|
30
|
+
root_url.should == 'http://www.mysite.test/'
|
31
31
|
end
|
32
32
|
|
33
33
|
it "should have the default host prefix and default locale" do
|
34
|
-
root_url(:site => 'us').should == 'http://www.
|
34
|
+
root_url(:site => 'us').should == 'http://www.mysite.test/'
|
35
35
|
end
|
36
36
|
|
37
37
|
it "should error if site is not supported" do
|
@@ -41,13 +41,13 @@ describe FoobarController , "locale specific routes", :type => :controller do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should allow for locale override" do
|
44
|
-
root_url(:site => 'it').should == 'http://www.it.
|
44
|
+
root_url(:site => 'it').should == 'http://www.it.mysite.test/'
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should set the default site when Locale is set" do
|
48
48
|
original_locale = I18n.locale
|
49
49
|
I18n.locale = Localized::Config.site_to_locale_map[:es]
|
50
|
-
root_url.should == 'http://www.es.
|
50
|
+
root_url.should == 'http://www.es.mysite.test/'
|
51
51
|
I18n.locale = original_locale
|
52
52
|
end
|
53
53
|
|