Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (20 sloc) 0.641 kB
module WebratHelper
SELECTORS_DIR = RAILS_ROOT + "/spec/selectors" unless defined?(SELECTORS_DIR)
def load_selectors(*filenames)
@selectors ||= {}
filenames.each { |filename| @selectors.merge!(YAML::load(File.read(SELECTORS_DIR + "/#{filename.to_s}.yml"))) }
end
def have_element(element)
have_xpath(@selectors[element.to_s])
end
def should_have_element(element)
it "should have #{element.to_s}" do
response.should have_element(element)
end
end
def should_not_have_element(element)
it "should not have #{element.to_s}" do
response.should_not have_element(element)
end
end
end
Jump to Line
Something went wrong with that request. Please try again.