I am trying to run the rake test on the sample app and I have 1 error that I cannot seem to shift.
`ERROR["test_invalid_signup_information", UsersSignupTest, 0.717775303] test_invalid_signup_information#UsersSignupTest (0.72s)ArgumentError: ArgumentError: unknown command 'v' test/integration/users_signup_test.rb:15:in `test' test/integration/users_signup_test.rb:15:in `block in <class:UsersSignupTest>' test/integration/users_signup_test.rb:15:in `test' test/integration/users_signup_test.rb:15:in `block in <class:UsersSignupTest>'
16/16: [=] 100% Time: 00:00:00, Time: 00:00:00
Finished in 0.72207s
16 tests, 34 assertions, 0 failures, 1 errors, 0 skips1
it seems to point to the users_signup page which I have pasted below.
`require 'test_helper'
class UsersSignupTest < ActionDispatch::IntegrationTest
test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post users_path, user: { name: "",
email: "user@invalid",
password: "foo",
password_confirmation: "bar" }
end
assert_template 'users/new'
test "valid signup information" do
get signup_path
name = "Example User"
email = "user@example.com"
password = "password"
assert_difference 'User.count', 1 do
post_via_redirect users_path, user: { name: name,
email: email,
password: password,
password_confirmation: password }
end
assert_template 'users/show'
end
end
end
can anyone see the error?
Perhaps because you didn't close the control flow structure of the first test ? There's an end
missing.
Try with the code like this:
require 'test_helper'
class UsersSignupTest < ActionDispatch::IntegrationTest
test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post users_path, user: { name: "",
email: "user@invalid",
password: "foo",
password_confirmation: "bar" }
end
assert_template 'users/new'
end
test "valid signup information" do
get signup_path
name = "Example User"
email = "user@example.com"
password = "password"
assert_difference 'User.count', 1 do
post_via_redirect users_path, user: { name: name,
email: email,
password: password,
password_confirmation: password }
end
assert_template 'users/show'
end
end