Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Rails 3.1: Test engine with Cucumber & test/dummy app

Run from the root of the engine project:

rails generate cucumber:install --capybara

Edit features/support/env.rb and add to the top:

ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../../test/dummy/config/environment.rb",  __FILE__)
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "../../../test/dummy"

Now from the root of the engine project:

cucumber features
@visoft

This comment has been minimized.

Show comment Hide comment
@visoft

visoft Aug 9, 2011

Thanks for this!

visoft commented Aug 9, 2011

Thanks for this!

@coryschires

This comment has been minimized.

Show comment Hide comment
@coryschires

coryschires Sep 18, 2011

+1 Worked for me too!

+1 Worked for me too!

@amazing-jay

This comment has been minimized.

Show comment Hide comment
@amazing-jay

amazing-jay Nov 24, 2011

+1 for me too

+1 for me too

@xavierdutreilh

This comment has been minimized.

Show comment Hide comment
@xavierdutreilh

xavierdutreilh Dec 10, 2011

Woohoo, nice gist. Worked for me too. :-)

Woohoo, nice gist. Worked for me too. :-)

@StephD

This comment has been minimized.

Show comment Hide comment
@StephD

StephD Apr 10, 2012

+1 Thanks

StephD commented Apr 10, 2012

+1 Thanks

@harmdewit

This comment has been minimized.

Show comment Hide comment
@harmdewit

harmdewit Jul 5, 2012

+1 Woah this worked, thanks!

+1 Woah this worked, thanks!

@segantii-alex-falkowski

This comment has been minimized.

Show comment Hide comment
@segantii-alex-falkowski

segantii-alex-falkowski Apr 7, 2015

I keep getting

Migrations are pending. To resolve this issue, run:

    bin/rake db:migrate RAILS_ENV=test

Even though I run it. I keep getting this message. Any idea?

I keep getting

Migrations are pending. To resolve this issue, run:

    bin/rake db:migrate RAILS_ENV=test

Even though I run it. I keep getting this message. Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment