Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

141 lines (132 sloc) 5.34 kb
@no-txn @works @search
Feature: Search Works
In order to test search
As a humble coder
I have to use cucumber with thinking sphinx
Scenario: first check the errors for an invalid search
When I am on the homepage
And I fill in "site_search" with "Tag: harry potter Words: >1000 (Language: Deutsch | Tag: Deutsch)"
And I press "search"
Then I should see "bad words format (ignored)"
And I should see "0 Found"
# do everything that doesn't modify the works in one scenario
# so you only have to load the fixtures and update the sphinx indexes once
Scenario: Search works
Given I have loaded the fixtures
And I have Battle 12 prompt meme fully set up
And everyone has signed up for Battle 12
When mod fulfills claim
When I reveal the "Battle 12" challenge
When I am logged in as "myname4"
And the work indexes are updated
# anon work doesn't show up in searches
When I search for works containing "mod"
Then I should see "0 Found"
When I search for works by mod
Then I should see "0 Found"
# reveal works
When I reveal the authors of the "Battle 12" challenge
When the work indexes are updated
When I am logged in as "myname4"
When I search for works containing "mod"
Then I should see "0 Found"
When I search for works by mod
Then I should see "0 Found"
# do some valid searches
When I search for a complex term from the search box
Then I should see appropriate results for that complex term
When I search for a simple term from the search box
Then I should see "3 Found"
When I follow "Advanced search"
Then I should be on the search page
When I fill in "refine_text" with ""
And I fill in "refine_tag" with "second"
And I press "Search works"
Then I should see "1 Found"
When I am on the search page
And I select "Deutsch" from "Language:"
And I press "Search works"
Then I should see "1 Found"
When I am on the homepage
And I fill in "site_search" with "hits: 0-10"
And I press "search"
Then I should see "4 Found"
When I am on the homepage
And I fill in "site_search" with "hits: >10"
And I press "search"
Then I should see "2 Found"
When I follow "Advanced search"
Then I should be on the search page
When I fill in "refine_hit_count" with "10000-20000"
And I press "Search works"
Then I should see "1 Found"
When I am on the homepage
And I fill in "site_search" with "words: 50-150"
And I press "search"
Then I should see "1 Found"
When I am on the homepage
And I fill in "site_search" with "words: >100 language:english"
And I press "search"
Then I should see "2 Found"
When I follow "Advanced search"
Then I should be on the search page
When I fill in "refine_word_count" with ""
And I fill in "refine_revised_at" with "> 2 years ago"
And I press "Search works"
# TODO: It's now more than 2 years since 2009 - should the fixtures be updated?
Then I should see "2 Found"
When I follow "Advanced search"
Then I should be on the search page
When I fill in "refine_word_count" with "<1000"
And I press "Search works"
Then I should see "0 Found"
When I am on the search page
And I fill in "refine_hit_count" with "> 1.000"
And I press "Search works"
Then I should see "First work"
And I should see "third work"
And I should see "2 Found"
And I should see "You searched for: Hits: > 1000"
When I fill in "refine_text" with "hits: >9,000"
And I press "Refine search"
Then I should see "You searched for: Hits: >9000"
And I should see "1 Found"
And I should not see "First work"
And I should see "third work"
When I am on the homepage.
And I fill in "site_search" with "testuser2"
And I press "search"
Then I should see "2 Found"
When I follow "Advanced search"
Then I should be on the search page
When I fill in "refine_text" with ""
And I fill in "refine_author" with "testuser2"
And I press "search"
# should actually be 5, but it appears to be losing the author bit
Then I should see "6 Found"
# When I am on the search page
# And I fill in "Kudos" with ">0"
# And I press "Search works"
# Then I should see "You searched for: Kudos: >0"
# And I should see "2 Found"
# When I follow "Advanced search"
# And I fill in "Kudos" with "5"
# And I press "Search works"
# Then I should see "You searched for: Kudos: 5"
# And I should see "0 Found"
# When I fill in "refine_text" with "kudos: 4"
# And I press "Refine search"
# Then I should see "You searched for: Kudos: 4"
# Then I should see "1 Found"
# When I follow "Advanced search"
# And I fill in "Kudos" with "<2"
# And I press "Search works"
# Then I should see "You searched for: Kudos: <2"
# Then I should see "5 Found"
# Then search for non-wips
# When I follow "Advanced search"
# And I check "Complete"
# And I press "Search works"
# Then I should see "You searched for: Kudos: <2 Complete"
# Then I should see "4 Found"
# 3 from the fixtures and one from the challenge
Jump to Line
Something went wrong with that request. Please try again.