2017-07-09 17:49:52 +00:00
|
|
|
# frozen_string_literal: true
|
2017-07-10 13:40:03 +00:00
|
|
|
|
2016-08-06 16:41:18 +00:00
|
|
|
require "helper"
|
|
|
|
require "jobs/translated_hello_job"
|
2015-07-07 19:52:28 +00:00
|
|
|
|
|
|
|
class TranslationTest < ActiveSupport::TestCase
|
|
|
|
setup do
|
|
|
|
JobBuffer.clear
|
|
|
|
I18n.available_locales = [:en, :de]
|
2016-08-06 16:41:18 +00:00
|
|
|
@job = TranslatedHelloJob.new("Johannes")
|
2015-07-07 19:52:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
teardown do
|
|
|
|
I18n.available_locales = [:en]
|
|
|
|
end
|
|
|
|
|
2016-08-06 16:41:18 +00:00
|
|
|
test "it performs the job in the given locale" do
|
2015-07-07 19:52:28 +00:00
|
|
|
@job.locale = :de
|
|
|
|
@job.perform_now
|
|
|
|
assert_equal "Johannes says Guten Tag", JobBuffer.last_value
|
|
|
|
end
|
|
|
|
end
|