Reindexing Solr from Cucumber

August 31, 2010 Mike Barinek

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

About the Author

Biography

More Content by Mike Barinek
Previous
National Lab Day seeks Ruby Developer in NYC
National Lab Day seeks Ruby Developer in NYC

At Pivotal Labs, one of the services we provide our clients is helping them interview and hire. Pivotal Lab...

Next
Free Version of Tweed no longer compatible with Twitter Authentication
Free Version of Tweed no longer compatible with Twitter Authentication

Twitter has been completing the migration of third party applications, such as Tweed, to use their new auth...

Enter curious. Exit smarter.

Register Now