我停用了用户注册(Gem Devise),我想进行测试以确保该路线/users/sign_up
不存在。
为此,我在spec/features/user_spec.rb
require 'spec_helper'
require 'capybara/rspec'
feature "Users" do
scenario "could not register " do
expect(:get => "/users/sign_up").not_to be_routable
end
end
当我运行这个测试时,我有这个错误:
1) Users could not register
Failure/Error: expect(:get => "/users/sign_up").not_to be_routable
NoMethodError:
undefined method `routable?' for {:get=>"/users/sign_up"}:Hash
# ./spec/features/user_spec.rb:8:in `block (2 levels) in <top (required)>'