Topic: When I fill the form properly
This particular step is giving me problems as its unreliable some time it works and then i can run the test 10s later and it passes
When /^I fill the form properly$/ do
@f_test = Fabricate(:test)
@service = Service.where("account_id = ?" , 1).order("LOWER(name)")
@staff = Staff.where("account_id = ?" , 1).order("LOWER(first_name)")
fill_in('test_name', :with => @f_test.name)
fill_in('test_description', :with => @f_test.description)
select(@service.last.name, :from => "test_service_id")
select(@staff.last.first_name, :from => "test_staff_id")
endOUT PUT
When I fill the form properly # features/step_definitions/test.rb:1
cannot select option, no option with text 'Mason' in select box 'test_staff_id' (Capybara::ElementNotFound)
(eval):2:in `select'
./features/step_definitions/test.rb:33:in `/^I fill the form properly$/'
features/test.feature:26:in `When I fill form properly'
How can i write this test so that it works better
Last edited by moiseszaragoza (2012-06-25 16:29:07)