0
にhave_linkマッチャーを破る私はrails 4.2.6
またはrails 4.2.7.1
にアップグレードする場合、私は次のエラーを取得するrails 4.2.5.2
のRails 4.2.6電子メール
expect(@mail.first.body.encoded).to have_link('here',
href: edit_questionaire_url(questionaire))
で動作テストを、持っています。
Failure/Error:
expect(@mail.first.body.encoded).to have_link('here',
href: edit_questionaire_url(questionaire))
expected to find link "here" with href "http://www.example.com/questionaires/1/edit" but there were no matches. Also found "here", which matched the selector but not all filters.
私はテストとの@ mail.bodyにURLを比較すると、彼らは離れて引用符から、同じです:
\"http://www.example.com/questionaires/1/edit\" - body of email
"http://www.example.com/questionaires/1/edit" - test error
他の多くの同様の試験は現在、破壊されています。これをどうやって解決するのですか?
おそらく見積もりが重要です。あなたはすべての属性を持つリンク全体を投稿できますか? – slowjack2k
私はそれも 'mail'の宝石を更新したと思いますし、何らかの理由でエンコーディングが少し変更されました - エンコードされた文字列に対してCapybaraを使用しようとしているのではなく、' capybara-email' –
いいえ、私は '' encoded'の出力が有効なhtmlであると疑っているので、実際には驚いています。文字列(正確にはNokogiriで解析可能)と一緒に使うとCapybaras have_link matcherが基本的に必要とします。 –