Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save barinek/553458 to your computer and use it in GitHub Desktop.

Select an option

Save barinek/553458 to your computer and use it in GitHub Desktop.
Cucumber performance improvements with Devise Token Authenticatable
We're using Devise's token_authenticatable to improve Cucumber test suite performance.
Here's an example feature
Scenario: I would like to edit a user account
Given I am logged in as an admin user
...
And here's the step
Given /^(?:I am logged in|the user is logged in|the user logs in|I log in)(?: as an? (\w+) user)?$/ do |role|
if ENV['use_token']
visit admin_dashboard_path(:token => @user.authentication_token)
else
Given("the user logs in with email: \"#{@user.email}\", password: \"#{@password}\"")
...
end
We'll then run cucumber using a "faster" profile
cucumber -p faster
Here's our cucumber.yml
faster: <%= std_opts %> features FASTER=true
@gvarela
Copy link
Copy Markdown

gvarela commented Aug 27, 2010

May want to add that you can add a new profile to your cucumber setup to run with this. Ours is cucumber -p faster. Checkout config/cucumber.yml.

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