お世話になっております。
個人で開発しているプロダクトにRSpecでの統合テストを実装しておりますが、
リンクをクリックする際の Capybara::ElementNotFound
が解消出来ずにハマってしまったので質問させていただきます。
GitHub issue
https://github.com/masarusan24/hanaguri-silver/issues/25
環境
- Ruby 2.5.1
- Rails 5.1.5
- RSpec 3.6.0
- Capybara 2.13
- i18n化している
※その他gemのバージョンはGitHub上のGemfile参照
エラー発生部分のコード
spec/features/games_spec.rb
Ruby
1require 'rails_helper' 2 3RSpec.feature "Games", type: :feature do 4 scenario 'user creates a new game' do 5 user = FactoryBot.create(:user) 6 7 visit admin_menu_path 8 # TODO: Capybara::ElementNotFoundが発生 9 click_link t(:new_game) 10 end 11end
実行結果
$ bin/rspec spec/features/ Running via Spring preloader in process 55289 Games user creates a new game (FAILED - 1) Failures: 1) Games user creates a new game Failure/Error: click_link t(:new_game) Capybara::ElementNotFound: Unable to find visible link "新規試合登録" # ./spec/features/games_spec.rb:9:in `block (2 levels) in <top (required)>' # -e:1:in `<main>' Finished in 0.34562 seconds (files took 1.95 seconds to load) 1 example, 1 failure Failed examples: rspec ./spec/features/games_spec.rb:4 # Games user creates a new game
以下の記事を参考にI18n.tメソッドを使ってclick_linkでリンクを踏ませる想定ですが、現状エラー解消出来ていない状態です。
解決方法に関してアドバイスいただけますでしょうか。
よろしくお願いいたします。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。