我收到以下 rSpec 测试失败错误。
我做错了什么?
非常感谢..
1)身份验证登录页面失败/错误:在{访问signin_path}之前NameError:未定义的局部变量或方法signin_path' for ## ./spec/requests/authentication_pages_spec.rb:8:inblock (3 levels) in '
2)身份验证登录页面失败/错误:在{访问signin_path}之前NameError:未定义的局部变量或方法signin_path' for ## ./spec/requests/authentication_pages_spec.rb:8:inblock (3 levels) in '
session_controller.rb:
class SessionsController < ApplicationController
def
new
end
def
create
end
def
destroy
end
end
路线.rb:
SampleApp::Application.routes.draw do
resources :users
resources :sessions, only: [:new, :create, :destroy]
root to: 'static_pages#home'
match '/signup', to: 'users#new'
match '/signin', to: 'sessions#new'
match '/signout', to: 'sessions#destroy', via: :delete
authentication_pages_spec.rb:
require 'spec_helper'
describe "Authentication" do
subject { page }
describe "signin page" do before { visit signin_path }
it { should have_selector('h1', text: 'Sign in') }
it { should have_selector('title', text: 'Sign in') }
end
结尾