2
我的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')也没有内容。