Tag: rspec2 capybara

Factory Girl / Capybara从数据库测试中删除记录?

与RSpec和Capybara合作,我得到了一个有趣的测试失败模式,在测试用例中有一些细微的重排线……这些都不重要。 我正在开发自己的身份validation系统。 它目前正在工作,我可以登录/退出浏览器和会话工作等等。但是,尝试测试这是失败的。 正在发生的事情我不太明白,这似乎取决于(看似)不相关的电话的顺序。 require ‘spec_helper’ describe “Sessions” do it ‘allows user to login’ do #line one user = Factory(:user) #For SO, this method hashes the input password and saves the record user.password! ‘2468’ #line two visit ‘/sessions/index’ fill_in ‘Email’, :with => user.email fill_in ‘Password’, :with => ‘2468’ click_button ‘Sign in’ page.should have_content(‘Logged in’) end […]