Is there somewhere a real documentation about using Cucumber + Webrat in
a Rails project?
For instance it seems that Cucumber doesn’t understand the word “Given”
like Story Runner does.
Is there somewhere a real documentation about using Cucumber + Webrat in
a Rails project?
For instance it seems that Cucumber doesn’t understand the word “Given”
like Story Runner does.
On Sep 28, 2008, at 2:50 PM, Fernando P. wrote:
Is there somewhere a real documentation about using Cucumber +
Webrat in
a Rails project?For instance it seems that Cucumber doesn’t understand the word
“Given”
like Story Runner does.
How about this?
Scott
Bloody keyboard! del and enter keys are too close to one another…
So my other questions are:
Where does Cucumber take its DB data from? Does it use the dev DB?
Does it copy the data from my dev DB into the test DB? When I run rake
features while my dev mongrel is running, I see some stuff going on in
the DB.
Can I use Autotest with Cucumber+Webrat? How to automate it?
Any tutorials to suggest?
On Sun, Sep 28, 2008 at 1:55 PM, Fernando P. [email protected]
wrote:
Bloody keyboard! del and enter keys are too close to one another…
So my other questions are:
- Where does Cucumber take its DB data from? Does it use the dev DB?
Does it copy the data from my dev DB into the test DB? When I run rake
features while my dev mongrel is running, I see some stuff going on in
the DB.
If you follow the directions at
GitHub: Let’s build from here · GitHub, the
‘script/generate cucumber’ step will configure things so it runs
against your test db and wraps each scenario in a transaction.
- Can I use Autotest with Cucumber+Webrat? How to automate it?
There is no support for that.
- Any tutorials to suggest?
Check out whatever you can find for RSpec’s Story Runner. It’s almost
the same except the feature files should use the .feature extension,
there is no steps_for or with_steps_for methods, and directory
structure is treated differently (per cucumber wiki).
Thank you David,
Is there a way to skip database initialization? Because it takes too
much time to run each test. Is there a similar way to mock objects or
create objects and have them “saved” in memory? I don’t understand how
to do that.
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 exmaple for that?
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.
On Mon, Sep 29, 2008 at 5:10 AM, Fernando P. [email protected]
wrote:
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}”…); … endBut this uses the testing DB isn’t it?
Yes, but that’s OK w/ cucumber. This isn’t unit testing.
On Sun, Sep 28, 2008 at 4:24 PM, Fernando P. [email protected]
wrote:
Thank you David,
Is there a way to skip database initialization? Because it takes too
much time to run each test. Is there a similar way to mock objects or
create objects and have them “saved” in memory? I don’t understand how
to do that.
Recommended practice is to use the database so you’re exercising as
close to the full stack as possible. Depending on whether or not you
use any custom sql, you could try running against an in-memory sqlite3
database
http://nubyonrails.com/articles/2006/06/01/san-francisco-sqlite3-memory-tests-asteroids
On Mon, Sep 29, 2008 at 3:14 PM, Fernando P. [email protected]
wrote:
Thanks Dave, I am starting to understand better the workflow to adopt
with cucumber and webrat.By the way I am having some issues with the: I should see “…” regexp.
If what I want to see has double quotes or brackets, it seems to fail
and not properly detect the string.
Please file a bug report…
Aslak
Thanks Dave, I am starting to understand better the workflow to adopt
with cucumber and webrat.
By the way I am having some issues with the: I should see “…” regexp.
If what I want to see has double quotes or brackets, it seems to fail
and not properly detect the string.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs