rails tutorialのログイン機能の統合テストを行っている際に
rails
1ERROR["test_invalid_signup_information", UsersSignupTest, 0.422623649000343] 2 test_invalid_signup_information#UsersSignupTest (0.42s) 3ArgumentError: ArgumentError: unknown command 'v' 4 test/integration/users_signup_test.rb:14:in `test' 5 test/integration/users_signup_test.rb:14:in `block in <class:UsersSignupTest>' 6 7 20/20: [==================================] 100% Time: 00:00:00, Time: 00:00:00 8 9Finished in 0.54372s 1020 tests, 46 assertions, 0 failures, 1 errors, 0 skips
のエラーが発生してしまいました。
unknown command 'v'が何を表しているのかが理解できず、苦しんでいます。
どなたかお助けいただけると幸いです。
以下がテスト内容です。
rails
1test "invalid signup information" do 2 get signup_path 3 assert_no_difference 'User.count' do 4 post users_path, params: { user: { name: "", 5 email: "user@invalid", 6 password: "foo", 7 password_confirmation: "bar" } } 8 end
test/integration/users_signup_test.rb の全文ではないようです。8行しか無い。
14行目ってどこですか?
早速のへんしんありがとうございます。
以下がファイル前文で、14行目は
test "valid signup information" doになります
====================
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'
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
end