2
describe "create post", :js => true do
  before :each do
  a = User.create!(:email => 'any@gmail.com', :password => 'admin123', :password_confirmation => 'admin123', :firstname => "black")
  a.confirm!
end

it "signs me in" do

  get root_path
  visit '/'
   within(".form-inline") do
     fill_in 'Email', :with => 'any@gmail.com'
     fill_in 'Password', :with => 'admin123'        
   end
   click_button 'Sign in'

    save_and_open_page
  end
 end

当我使用 rake spec:requests 执行时

我无法登录,我在浏览器中收到无效的电子邮件或密码错误。请告诉我该怎么办?

4

0 回答 0