誰でもこの種のテストを経験しましたか?アクセント記号付きのRspec have_link
このアウトドア:
# this works
it { should have_link("Next") }
しかし "Próximo" のようなアクセントを含む単語を用いて同じ試験を(ポルトガル語を意味する次の)
# 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を使用していますか? Ruby 1.9.3、Rails 3.2、RSpec 2.8、そしてそのコメントで、私はちょうどページにhave_link( "Próximo")} 'を試してみました。 – pjumble
rails 3.2.1、ruby 1.9.2p290およびrspec 2.8.1 - それは失敗します –