Sha256: d3eb9d9bd76c923a625310eb726ae2e987409b24b9326586e9d486160d507a00

Contents?: true

Size: 912 Bytes

Versions: 41

Compression:

Stored size: 912 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))

# Gives a way to test how many items are on a given page either gallery or list
Then /^I should see (\d+) (gallery|list) results$/ do |number,type|
  if type == "gallery"
    results_num = page.body.scan(/<div class=\"document thumbnail\">/).length
  elsif type == "list"
    results_num = page.body.scan(/<tr class=\"document (odd|even)\">/).length
  else
    results_num = -1
  end
  results_num.should == number.to_i
end

# simple way to check for elements in the dom (needed for per_page bug check)
Then /^I (should not|should) see an? "([^\"]*)" tag with an? "([^\"]*)" attribute of "([^\"]*)"$/ do |bool,tag,attribute,value|
  if bool == "should not"
    page.should_not have_xpath("//#{tag}[contains(@#{attribute}, #{value})]")
  else
    page.should have_xpath("//#{tag}[contains(@#{attribute}, #{value})]")
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
hydra-head-4.1.3 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.1.2 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.1.1 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.1.0 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.3 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.2 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.1 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.0 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.0.rc6 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.0.rc5 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.0.rc4 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.0.rc3 test_support/features/step_definitions/searching_steps.rb
hydra-head-4.0.0.rc2 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.3.0 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.2.2 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.2.1 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.2.0 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.2.0.pre3 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.2.0.pre2 test_support/features/step_definitions/searching_steps.rb
hydra-head-3.2.0.pre1 test_support/features/step_definitions/searching_steps.rb