r18n-rails 3.0.3 → 3.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 66f72c9d7c12fe0e892197757fc6664260503c23c33f01a56f855b55d2afb215
4
- data.tar.gz: 118af7f7d8a61bdea79ab83fa3b56ed21a823eb731f14841553cc9fd8b96a9d9
3
+ metadata.gz: 0e58873d6c673bf48aab54203b3012f193c1a47b94f5e81d946232d93a0aa8ec
4
+ data.tar.gz: 4c45c176f12cb5cf662af4b062dea436af374c5f6a0381bbc4ffaadb400bce69
5
5
  SHA512:
6
- metadata.gz: 9ec94844d8397dba1e3226d5483b66f771c151099e9b7fd6c6e5780526f6d2f322d4a171ee483ac28cc4afdf7997a85413ae8b65f78b6201cb0c1148d5a69f8d
7
- data.tar.gz: e34583222a72b9220491de8dfea869695e25319108f3af8e7b638ad314a3a41c4698aff7378260af409721444a7270180183aaaaf32ecb14c8c3c52ca26ab18c
6
+ metadata.gz: d264389825e9c648ffb3b30faa4d1c55aec70c5e4d2e2aa8b60869dccfc263a61db3ec27d95eebe4ece0e2e264fec47cab9f3378b0ecdc24f9a9d42c1607a885
7
+ data.tar.gz: da0bd4f1c41878abcc701b5fde72b5359519295b5494e91c4377616cd3e3f15ba7c72d51c0887420d9c2368eecc7e81bea3081401f0233ac1a3154df04c29ac8
@@ -17,6 +17,8 @@ module App
17
17
  config.i18n.default_locale = :ru
18
18
  config.encoding = 'utf-8'
19
19
 
20
+ config.active_record.sqlite3.represent_boolean_as_integer = true
21
+
20
22
  def config.database_configuration
21
23
  sqlite = { 'adapter' => 'sqlite3', 'database' => ':memory:' }
22
24
  sqlite['adapter'] = 'jdbcsqlite3' if RUBY_PLATFORM == 'java'
@@ -5,50 +5,50 @@ describe TestController, type: :controller do
5
5
 
6
6
  it 'uses default locale' do
7
7
  get :locales
8
- expect(response).to be_success
8
+ expect(response).to have_http_status(200)
9
9
  expect(response.body).to eq 'ru'
10
10
  end
11
11
 
12
12
  it 'gets locale from param' do
13
13
  get :locales, params: { locale: 'ru' }
14
- expect(response).to be_success
14
+ expect(response).to have_http_status(200)
15
15
  expect(response.body).to eq 'ru, en'
16
16
  end
17
17
 
18
18
  it 'gets locale from session' do
19
19
  get :locales, session: { locale: 'ru' }
20
- expect(response).to be_success
20
+ expect(response).to have_http_status(200)
21
21
  expect(response.body).to eq 'ru, en'
22
22
  end
23
23
 
24
24
  it 'gets locales from http' do
25
25
  request.env['HTTP_ACCEPT_LANGUAGE'] = 'ru,fr;q=0.9'
26
26
  get :locales
27
- expect(response).to be_success
27
+ expect(response).to have_http_status(200)
28
28
  expect(response.body).to eq 'ru, fr, en'
29
29
  end
30
30
 
31
31
  it 'loads translations' do
32
32
  get :translations, params: { locale: 'en' }
33
- expect(response).to be_success
33
+ expect(response).to have_http_status(200)
34
34
  expect(response.body).to eq 'R18n: supported. Rails I18n: supported'
35
35
  end
36
36
 
37
37
  it 'returns available translations' do
38
38
  get :available
39
- expect(response).to be_success
39
+ expect(response).to have_http_status(200)
40
40
  expect(response.body).to eq 'en ru'
41
41
  end
42
42
 
43
43
  it 'adds helpers' do
44
44
  get :helpers, params: { locale: 'en' }
45
- expect(response).to be_success
45
+ expect(response).to have_http_status(200)
46
46
  expect(response.body).to eq "Name\nName\nName\nName\n"
47
47
  end
48
48
 
49
49
  it 'formats untranslated' do
50
50
  get :untranslated
51
- expect(response).to be_success
51
+ expect(response).to have_http_status(200)
52
52
  expect(response.body).to eq(
53
53
  'user.<span style="color: red">[not.exists]</span>'
54
54
  )
@@ -56,19 +56,19 @@ describe TestController, type: :controller do
56
56
 
57
57
  it 'adds methods to controller' do
58
58
  get :controller, params: { locale: 'en' }
59
- expect(response).to be_success
59
+ expect(response).to have_http_status(200)
60
60
  expect(response.body).to eq 'Name Name Name'
61
61
  end
62
62
 
63
63
  it 'localizes time by Rails I18n' do
64
64
  get :time, params: { locale: 'en' }
65
- expect(response).to be_success
65
+ expect(response).to have_http_status(200)
66
66
  expect(response.body).to eq "Thu, 01 Jan 1970 00:00:00 +0000\n01 Jan 00:00"
67
67
  end
68
68
 
69
69
  it 'localizes time by R18n' do
70
70
  get :human_time, params: { locale: 'en' }
71
- expect(response).to be_success
71
+ expect(response).to have_http_status(200)
72
72
  expect(response.body).to eq 'now'
73
73
  end
74
74
 
@@ -119,20 +119,20 @@ describe TestController, type: :controller do
119
119
 
120
120
  it 'reloads filters from app directory' do
121
121
  get :filter, params: { locale: 'en' }
122
- expect(response).to be_success
122
+ expect(response).to have_http_status(200)
123
123
  expect(response.body).to eq 'Rails'
124
124
  expect(R18n::Rails::Filters.loaded).to eq [:rails_custom_filter]
125
125
 
126
126
  R18n::Filters.defined[:rails_custom_filter].block = proc { 'No' }
127
127
  get :filter, params: { locale: 'en' }
128
128
 
129
- expect(response).to be_success
129
+ expect(response).to have_http_status(200)
130
130
  expect(response.body).to eq 'Rails'
131
131
  end
132
132
 
133
133
  it 'escapes html inside R18n' do
134
134
  get :safe, params: { locale: 'en' }
135
- expect(response).to be_success
135
+ expect(response).to have_http_status(200)
136
136
  expect(response.body).to eq(
137
137
  "<b> user.<span style=\"color: red\">[no_tr]</span>\n"
138
138
  )
@@ -140,7 +140,7 @@ describe TestController, type: :controller do
140
140
 
141
141
  it 'works with Rails build-in herlpers' do
142
142
  get :format
143
- expect(response).to be_success
143
+ expect(response).to have_http_status(200)
144
144
  expect(response.body).to eq "1 000,1 руб.\n"
145
145
  end
146
146
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Sitnik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-11 00:00:00.000000000 Z
11
+ date: 2018-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: r18n-rails-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.3
19
+ version: 3.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 3.0.3
26
+ version: 3.0.4
27
27
  description: |2
28
28
  Out-of-box R18n support for Ruby on Rails.
29
29
  It is just a wrapper for R18n Rails API and R18n core libraries.