Testing Selenium RSpec2在Rails 3上执行ActiveRecord查询时崩溃
我很难让我的测试正常进行 如果我有:js=>true(Selenium和Mozilla)并直接在模型上执行任何类型的ActiveRecord查询,我会遇到大问题 例如,此expect块不起作用Testing Selenium RSpec2在Rails 3上执行ActiveRecord查询时崩溃,testing,selenium,ruby-on-rails-3.1,rspec2,Testing,Selenium,Ruby On Rails 3.1,Rspec2,我很难让我的测试正常进行 如果我有:js=>true(Selenium和Mozilla)并直接在模型上执行任何类型的ActiveRecord查询,我会遇到大问题 例如,此expect块不起作用 pending 'displays flash error when another User contains email' do user = User.create!(:email => email) expect { fill_in 'Email', :with =>
pending 'displays flash error when another User contains email' do
user = User.create!(:email => email)
expect {
fill_in 'Email', :with => user.email
fill_in 'Password', :with => password
fill_in 'Re-enter', :with => password
check 'agree'
click_button 'Sign up'
}.to_not change(User, :count)
current_path.should eq(new_user_registration_path)
page.should have_content("Password doesn't match confirmation")
end
任何时候我有类似的
user = User.last
user.update_attributes(:agreement => nil)
它要么忽略代码,崩溃测试,将我重定向到登录页面,要么是其他一些自发的行为。这似乎并不一致。我甚至有一些MYSQL超时
还有其他人有类似的问题或知道如何解决吗