r18n-rails 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/r18n-rails.rb +2 -1
- data/lib/r18n-rails/controller.rb +3 -5
- data/lib/r18n-rails/mixin.rb +41 -0
- data/spec/app/app/controllers/test_controller.rb +5 -0
- data/spec/app/config/environment.rb +2 -0
- data/spec/app/log/test.log +2061 -0
- data/spec/rails_spec.rb +9 -3
- metadata +3 -2
data/spec/rails_spec.rb
CHANGED
@@ -9,7 +9,7 @@ describe 'R18n for Rails', :type => :controller do
|
|
9
9
|
it 'should use default locale' do
|
10
10
|
get :locales
|
11
11
|
response.should be_success
|
12
|
-
response.body.should == '
|
12
|
+
response.body.should == 'ru'
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'should get locale from param' do
|
@@ -32,7 +32,7 @@ describe 'R18n for Rails', :type => :controller do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should load translations' do
|
35
|
-
get :translations
|
35
|
+
get :translations, :locale => 'en'
|
36
36
|
response.should be_success
|
37
37
|
response.body.should == 'R18n: supported. Rails I18n: supported'
|
38
38
|
end
|
@@ -44,7 +44,7 @@ describe 'R18n for Rails', :type => :controller do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'should add helpers' do
|
47
|
-
get :helpers
|
47
|
+
get :helpers, :locale => 'en'
|
48
48
|
response.should be_success
|
49
49
|
response.body.should == "Name\nName\nName\nName\n"
|
50
50
|
end
|
@@ -55,6 +55,12 @@ describe 'R18n for Rails', :type => :controller do
|
|
55
55
|
response.body.should == "user.<span style='color: red'>not.exists</span>"
|
56
56
|
end
|
57
57
|
|
58
|
+
it "should add methods to controller" do
|
59
|
+
get :controller, :locale => 'en'
|
60
|
+
response.should be_success
|
61
|
+
response.body.should == "NameNameName"
|
62
|
+
end
|
63
|
+
|
58
64
|
it "should translate models" do
|
59
65
|
ActiveRecord::Schema.verbose = false
|
60
66
|
ActiveRecord::Schema.define(:version => 20091218130034) do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey "A.I." Sitnik
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-26 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -32,6 +32,7 @@ extra_rdoc_files:
|
|
32
32
|
- README.rdoc
|
33
33
|
- LICENSE
|
34
34
|
files:
|
35
|
+
- lib/r18n-rails/mixin.rb
|
35
36
|
- lib/r18n-rails/helpers.rb
|
36
37
|
- lib/r18n-rails/controller.rb
|
37
38
|
- lib/r18n-rails.rb
|