Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker

Cucumber performance improvements with Devise Token Authenticatable

Mike Barinek
Wednesday, September 1, 2010

We’re using Devise’s token_authenticatable to improve our 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 token_authenticatable 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

And finally, here’s our cucumber.yml


faster: <%= std_opts %> features FASTER=true

Our cucumber tests run significantly faster after switching to the token_authenticatable approach.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  1. Hugo Baraúna says:

    Interesting, nice tip!

    September 1, 2010 at 11:29 am

Add New Comment Cancel reply

Your email address will not be published.

Mike Barinek

Mike Barinek
Boulder

Recent Posts

  • American Thrombosis and Hemostasis Network (ATHN) is looking for a Web Application Developer
  • Portico is looking for a Web Application Developer
  • Testing Ruby Services without Mocks
Subscribe to Mike's Feed

Author Topics

boulder (4)
jobs (3)
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >