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?

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