Created
August 27, 2010 14:30
-
-
Save barinek/553458 to your computer and use it in GitHub Desktop.
Cucumber performance improvements with Devise Token Authenticatable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.