【发布时间】:2012-02-18 14:53:09
【问题描述】:
有人经历过这种考验吗?
这样做:
# this works
it { should have_link("Next") }
但相同的测试使用包含“Próximo”等重音的单词(在葡萄牙语中表示 Next)
# it fails
it { should have_link("Próximo") }
错误:
1) UserPages index pagination
Failure/Error: it { should have_link("Próximo") }
expected link "Próximo" to return something
# ./spec/requests/user_pages_spec.rb:29:in `block (4 levels) in <top (required)>'
Finished in 2.8 seconds
28 examples, 1 failure
user_pages_spec.rb(仅相关代码)
describe "pagination" do
before(:all) { 30.times { FactoryGirl.create(:user) } }
after(:all) { User.delete_all }
it { should_not have_link('delete') }
it { should have_link("Próximo") }
it { should have_link('2') }
end
我应该如何做这个测试?
【问题讨论】:
标签: ruby-on-rails-3 rspec tdd rspec2