
Being able to get to the db when in selenium mode.
Reported by Amos King | January 7th, 2009 @ 11:09 PM
As a develper running webrat in selenium mode I would like to be able to access the database for assertions
Right now this isn't possible:
require 'test_helper'
class PeopleIntegrationTest < ActionController::IntegrationTest
context "context no records" do
setup do
Person.create!(:name => 'Mike Gaffney')
visit(people_path)
click_link("Create New")
fill_in('Name', :with => "Amos King")
click_button('Create')
sleep 10
end
should 'respond with success' do
assert_equal '200', response.code
end
end
end
The Person Mike Gaffney doesn't exist.
Comments and changes to this ticket
-
Bryan Helmkamp January 17th, 2009 @ 11:06 AM
Amos -- You're saying the Person.create! won't work?
When using Selenium, you've got to disable "transactional fixtures" (even if you're not using Rails fixtures).
-
Amos King January 17th, 2009 @ 12:12 PM
create! works within one transaction, but when running in selenium mode there are two transactions. One is within the app server-db connection. The other is within the Test::Unit-db connection. This means that the create doesn't end up going across to the other connection.
This ticket is to find a way to either get a single connection to the database, and therefore one transaction or to automatically role back any objects created in the test.
I think this is a change that is far in the future, and needs a lot of research, and possibly a lot of code.
-
gaffo May 7th, 2009 @ 02:56 PM
- Tag set to featurerequest
- State changed from new to wontfix
This is fixed if you use http://github.com/gaffo/mainline...
Which puts the integration test and the selenium server in the same database connection.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Ruby Acceptance Testing for Web applications.