I’ve got a simple scheduling application. I’ve got a request spec set up to run through the flow of adding a new workout to the schedule, and the form appears to hang on submit and the script bails after a few seconds. Running through it manually works fine, and my controller and model specs are all passing without complaint.
The only funky thing is I’m using execute_script to interact with the jquery datepicker, which seems to be working okay. Watching the execution shows that no error is happening, it’s just hangs waiting for 127.0.0.1 to respond which doesn’t seem to happen.
describe "Workouts" do
describe 'Create Workouts', js: true do
it 'Creates a new workout and displays the workout\'s page' do
visit workouts_path
expect {
click_link "New Workout"
fill_in 'workout_name', with: 'Workout!'
fill_in '', with: '05/01/2012'
page.execute_script %Q{ $('#workout_show_date').trigger("focus") }
page.execute_script %Q{ $("a.ui-state-default:contains('15')").trigger("click") }
select('6', from: 'workout_time_4i')
select('15', from: 'workout_time_5i')
click_button 'Create Workout'
}.to change(Workout,:count).by(1)
end
end
end
So after putting a sleep in the spec the error started returning that the database was locked, which google revealed to be a problem related to transactional fixtures being turned on. Turned that off and now all my specs are passing