Skip to content

Commit

Permalink
spec for arrays in google translate #77
Browse files Browse the repository at this point in the history
  • Loading branch information
glebm committed Jul 24, 2014
1 parent 833de5b commit de99f8a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/google_translate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
include I18n::Tasks::GoogleTranslation

tests = [
text_test = ['a', "Hello - %{user} O'neill!", "Hola - %{user} O'neill!"],
html_test = ['a_html', "Hello - <b>%{user} O'neill</b>", "Hola - <b>%{user} O'neill</b>"]
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>"],
array_test = ['array-key', ['Hello.', 'Goodbye.'], ['Hola.', 'Adiós.']]
]


Expand All @@ -16,7 +17,7 @@
delegate :i18n_cmd, :i18n_task, :in_test_app_dir, to: :TestCodebase

context 'API' do
it 'works' do
it "works with #{tests.map(&:first)}" do
# Just one test with all the cases to lower the Google bill
translations = google_translate(
tests.map { |t| t[0..1] }, from: :en, to: :es, key: ENV['GOOGLE_TRANSLATE_API_KEY'])
Expand Down

0 comments on commit de99f8a

Please sign in to comment.