require 'test_helper'
class MyTest < ActionController::IntegrationTest
test "view posts from login page" do
visit("/logins/new")
find_field('Username').set('abode')
find_field('Password').set('efghi')
click_link_or_button('Login')
assert page.has_content?('Signed in!')
end
test "go to new user page" do
visit("/logins/new")
click_link("New user?")
assert (current_path == "/users/new")
end
end
Error:
test_view_posts_from_login_page(MyTest):
ActionController::RoutingError: No route matches [POST] "/logins/new"
test/integration/view_posts_test.rb:12:in `block in <class:MyTest>'
它显示第 12 行的错误。按钮“登录”或 /logins/new 路径是否有问题?第二个测试通过了,所以路径应该是正确的?我究竟做错了什么?
谢谢!