Commander Johnson
2011-Jan-07 13:27 UTC
When a Rails server saves an object, this is not visible in my concurrent integration test
Note: I''m on Rails version 2.3.8 Hello, I''m running integration tests on my controllers with a Watir-controller Firefox. So two processes are running at the same time: Process 1: Mongrel server in test environment (script/server -e test) Process 2: ActionController::IntegrationTest running (also in Test environment, obviously) A Product can be bought by a customer (Account) through a Subscription object. This is what happens: 1. IntegrationTest creates a new Product by saying Factory.create :product 2. The browser is redirected to the Product''s page and buys the product. 3. After going through the payment gateway, a Subscription object is created by Process 1 4. However, Process 2 DOES NOT SEE that this object was created 5. The integration test fails Going through this process manually in development mode does everything well, but I must automate this process. Any thoughts? --- Some notes: self.use_transactional_fixtures = false Thanks in advance! CmdJohnson -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2011-Jan-07 14:47 UTC
Re: When a Rails server saves an object, this is not visible in my concurrent integration test
On Jan 7, 1:27 pm, Commander Johnson <commanderjohn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Note: I''m on Rails version 2.3.8 > > Hello, > > I''m running integration tests on my controllers with a Watir-controller > Firefox. So two processes are running at the same time: > > Process 1: Mongrel server in test environment (script/server -e test) > Process 2: ActionController::IntegrationTest running (also in Test > environment, obviously) > > A Product can be bought by a customer (Account) through a Subscription > object. > > This is what happens: > > 1. IntegrationTest creates a new Product by saying Factory.create :product > 2. The browser is redirected to the Product''s page and buys the product. > 3. After going through the payment gateway, a Subscription object is created > by Process 1 > 4. However, Process 2 DOES NOT SEE that this object was created > 5. The integration test fails >Does your integration test just sit there checking every so often? Can you see the subscription in the database if you check by hand ? Fred> Going through this process manually in development mode does everything > well, but I must automate this process. Any thoughts? > > --- > > Some notes: > > self.use_transactional_fixtures = false > > Thanks in advance! > CmdJohnson-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.