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