我遇到了测试用户登录procces
的问题这是我的测试
require 'spec_helper'
include Warden::Test::Helpers
include Devise::TestHelpers
describe "UserSignin" do
it "should allow a registered user to sign in" do
user = FactoryGirl.create(:employer, :email => "email@email.com")
user.confirm!
visit "/users/sign_in"
fill_in "Email", :with => user.email
fill_in "Password", :with => "12345678"
click_button "Sign in"
current_path.should == '/employer'
expect(page).to have_content('My Account')
end
end
如果它是重要的我正在使用设备进行身份验证
在工厂我也有:employer
工厂
身份验证问题
点击sign_in
后我发现错误invalid email or password
更新
规范助手中的测试环境配置存在问题
解决方案是设置:
DatabaseCleaner.strategy = :truncation