前提・実現したいこと
railsチュートリアルを始めて8章あたりで以下のようなエラーが出てくる。
rails test をした結果エラーが出てきてググって解決法を探したが方法が見つけられない。
発生している問題・エラーメッセージ
ERROR["test_invalid_signup_information", UsersSignupTest] test_invalid_signup_information#UsersSignupTest Nokogiri::CSS::SyntaxError: Nokogiri::CSS::SyntaxError: unexpected '#' after '[#<Nokogiri::CSS::Node:0x00007f8fc5f834a8 @type=:ELEMENT_NAME, @value=["div"]>]' test/integration/users_signup_test.rb:14:in `block in <class:UsersSignupTest>'
該当のソースコード
require 'test_helper' class UsersSignupTest < ActionDispatch::IntegrationTest test "invalid signup information" do get signup_path assert_no_difference 'User.count' do post users_path, params: { user: { name: "", email: "user@invalid", password: "foo", password_confirmation: "bar" } } end assert_template 'users/new' assert_select 'div#<CSS id for error explanation>' assert_select 'div.<CSS class for field with error>' end test "valid signup information" do get signup_path assert_difference 'User.count', 1 do post users_path, params: { user: { name: "Example User", email: "user@example.com", password: "password", password_confirmation: "password" } } end follow_redirect! assert_template 'users/show' assert is_logged_in? end end
試したこと
ググったり、他の章で解決法がないか調べたが何も見つからなかった。
どうか原因と解決法を教えて下さい。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/26 00:50