0
@@ -12,12 +12,24 @@ module Spec
0
have_tag("label[for=#{attribute}]").matches?(response)
0
+ def with_label_for(attribute, text)
0
+ return simple_matcher("have a label for '#{attribute}' with value of '#{text}'") do |response|
0
+ with_tag("label[for=#{attribute}]").matches?(response)
0
def have_text_field_for(attribute)
0
return simple_matcher("have a text field for '#{attribute}'") do |response|
0
have_tag("input##{attribute}[type=text]").matches?(response)
0
+ def with_text_field_for(attribute)
0
+ return simple_matcher("with a text field for '#{attribute}'") do |response|
0
+ with_tag("input##{attribute}[type=text]").matches?(response)
0
def have_password_field_for(attribute)
0
return simple_matcher("have a password field for '#{attribute}'") do |response|
0
@@ -25,15 +37,33 @@ module Spec
0
+ def with_password_field_for(attribute)
0
+ return simple_matcher("have a password field for '#{attribute}'") do |response|
0
+ with_tag("input##{attribute}[type=password]").matches?(response)
0
def have_checkbox_for(attribute)
0
return simple_matcher("have a checkbox for '#{attribute}'") do |response|
0
have_tag("input##{attribute}[type=checkbox]").matches?(response)
0
+ def with_checkbox_for(attribute)
0
+ return simple_matcher("have a checkbox for '#{attribute}'") do |response|
0
+ have_tag("input##{attribute}[type=checkbox]").matches?(response)
0
return simple_matcher("have a submit button") do |response|
0
- have_tag("input[type=submit]").matches?(response)
0
+ with_tag("input[type=submit]").matches?(response)
0
+ def with_submit_button
0
+ return simple_matcher("have a submit button") do |response|
0
+ with_tag("input[type=submit]").matches?(response)
0
@@ -42,6 +72,12 @@ module Spec
0
have_tag("a[href=#{url_or_path}]", text).matches?(response)
0
+ def with_link_to(url_or_path, text = nil)
0
+ return simple_matcher("have a link to '#{url_or_path}'") do |response|
0
+ with_tag("a[href=#{url_or_path}]", text).matches?(response)
0
\ No newline at end of file
Comments
No one has commented yet.