导轨|如何创建非 ASCII 规范?
$rake spec
之后的代码
welcomes_spec.rb:
...
describe "GET /welcomes" do
it "Should render main page" do
visit root_path
page.should have_content(t("popular_photos"))
end
end
...
ru.yml
...
ru:
hello: "Hello world"
default_page_title: "Test_page_title"
main_page: "Главная"
popular_photos: !NON ASCII SYMBOLS HERE!
导致错误:
Failure/Error: page.should have_content(t("popular_photos"))
NoMethodError:
undefined method `t' for #<RSpec::Core::ExampleGroup::Nested_5::Nested_1:0xba77028>
我是新手,不知道如何修复它。
The code
welcomes_spec.rb:
...
describe "GET /welcomes" do
it "Should render main page" do
visit root_path
page.should have_content(t("popular_photos"))
end
end
...
ru.yml
...
ru:
hello: "Hello world"
default_page_title: "Test_page_title"
main_page: "Главная"
popular_photos: !NON ASCII SYMBOLS HERE!
after $rake spec
leads the error:
Failure/Error: page.should have_content(t("popular_photos"))
NoMethodError:
undefined method `t' for #<RSpec::Core::ExampleGroup::Nested_5::Nested_1:0xba77028>
I am newbie and don't know how to fix it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将: 替换
为:
Simply replace:
with: