【发布时间】:2012-03-23 13:20:35
【问题描述】:
我的 Capybaras 测试仅适用于默认语言环境,不适用于指定语言环境。
describe "How it works" do
it "should have the content 'how it works'" do
visit how_it_works_url(:locale => :en)
page.should have_content('How it works')
end
it "should have the content 'wie es geht'" do
visit how_it_works_url(:locale => :de)
page.should have_content('Wie es geht')
end
end
如果 default_locale 为 'en',则第一个测试通过,如果为 'de',则第二个测试通过。
既没有翻译路线(我使用 gem 'rails-translate-routes'),也没有翻译内容。
【问题讨论】:
标签: ruby-on-rails internationalization capybara