[rspec-users] Lot's o' questions about Cucumbert

Fernando Perez lists at ruby-forum.com
Mon Sep 29 06:10:58 EDT 2008

> Is there a way to skip database initialization? Because it takes too 
> much time to run each test. 
So do you handle data inside the testing environment. Let's say: Given 
there are 2 products available on the site.

Currently I am using 1.upto(2) do |i|; Product.create!(:title => 
"title#{i}"...); ... end

But this uses the testing DB isn't it?

> I use for instance Product.create!(:title => 'title', :price => '15'), 
> but I am not sure the object gets saved or is accessible by RSpec. Do 
> you have an example for that?
I fixed this problem, it was related to my other problem about 
request.domain during tests. With Story Runner, it gets set to 
example.com, whereas during controller testing it is set to test.host.
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list