views:

44

answers:

1

I'm trying to test Rails' Javascript with Cucumber/celerity and factorygirl. The stack itself works, but database is going crazy.

I'm running mongrel on 3001 port (tried in both cucumber and test environments) and access it from cucumber via celerity.

One of my tests looks following:

  • create item
  • 1 item exists
  • do smth with item

it works just fine if i use simple webrat interface.

but with celebrity, something in database is wrong:

  • create item #in cucumber
  • 1 item exists #in cucumber
  • 0 item exists #in celerity
  • 1 item exists #in cucumber
  • do smth with item #fails in celerity, but works in cucumber

Any ideas why Celerity'ed instance doesnt see what was saved in db in cucumber?

P.S. yes, both instance work with the same db....

+1  A: 

I found out that this was because Cucumber wrapped every step in transactions. Turned them off and everything works fine!

Mantas