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

Reindexing Solr from Cucumber

Mike Barinek
Tuesday, August 31, 2010

Here’s a quick snippet that we’re using to reindex Solr from our Cucumber features.

“And I reindex assets” helps to ensure that we didn’t leave any cruft around from previous
tests and that we’ve properly indexed our Pickle model.


  Background:
    And I am logged in as an admin user
    And an asset with snowboarding tags: "snowboarding" exists with title: "Snowboarding", alt_text: "Snowboarding", summary: "A summary about snowboards"
    And I reindex assets

  Scenario:  An Editor searches for an asset by title
    When I go to the url: "/assets?q=Snowboarding"
    Then I should see "Snowboarding"

Here’s the actual step


  When /^I reindex (.+)$/ do |model_name|
    model_name.singularize.capitalize.constantize.solr_reindex
  end

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

One comment

  1. Clay Shentrup says:

    Wait, why “capitalize” instead of “camelize”?

    September 6, 2010 at 7:08 pm

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 >