Skip to content

Commit

Permalink
Translation: Add test for empty key
Browse files Browse the repository at this point in the history
Refs #283
  • Loading branch information
glebm committed Aug 20, 2018
1 parent 5cac51e commit 4c83cf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions spec/google_translate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

RSpec.describe 'Google Translation' do
nil_value_test = ['nil-value-key', nil, nil]
empty_value_test = ['empty-value-key', '', '']
text_test = ['key', "Hello - %{user} O'Neill!", "Hola - %{user} O'Neill!"]
html_test = ['html-key.html', "Hello - <b>%{user} O'neill</b>", "Hola - <b>%{user} O'neill</b>"]
html_test_plrl = ['html-key.html.one', '<b>Hello %{count}</b>', '<b>Hola %{count}</b>']
Expand Down Expand Up @@ -40,6 +41,7 @@
},
'array_key' => array_test[1],
'nil-value-key' => nil_value_test[1],
'empty-value-key' => empty_value_test[1],
'fixnum-key' => fixnum_test[1],
'ref-key' => ref_key_test[1]
}
Expand All @@ -56,6 +58,7 @@
expect(task.t('common.hello_plural_html.one', 'es')).to eq(html_test_plrl[2])
expect(task.t('common.array_key', 'es')).to eq(array_test[2])
expect(task.t('common.nil-value-key', 'es')).to eq(nil_value_test[2])
expect(task.t('common.empty-value-key', 'es')).to eq(empty_value_test[2])
expect(task.t('common.fixnum-key', 'es')).to eq(fixnum_test[2])
expect(task.t('common.ref-key', 'es')).to eq(ref_key_test[2])
expect(task.t('common.a', 'es')).to eq('λ')
Expand Down

0 comments on commit 4c83cf3

Please sign in to comment.