lib/kelp/field.rb
# Verify that the given field does not contain the given value.
#
# @param [String] field
#   Capybara locator for the field (name, id, or label text)
# @param [String] value
#   Value you expect to not see in the text field
# @param [Hash] scope
#   Scoping keywords as understood by {#in_scope}
#
# @raise [Kelp::Unexpected]
#   If the given field contains `value`
#
Verify that the given field does not contain the given value.
Verify that the given field does not contain the given value .
def field_should_not_contain(field, value, scope={})
      in_scope(scope) do
        actual = field_value(field)
        expect_not = Regexp.escape(value)
        if (actual =~ /#{expect_not}/)
          raise Kelp::Unexpected,
            "Did not expect '#{field}' to contain '#{expect_not}'" + \
            "\nGot '#{actual}'"
        end
      end
    end
def field_should_not_contain ( field , value , scope = { } ) in_scope ( scope ) do actual = field_value ( field ) expect_not = Regexp . escape ( value ) if ( actual =~ / #{ expect_not } / ) raise Kelp :: Unexpected , "Did not expect '#{field}' to contain '#{expect_not}'" + "\nGot '#{actual}'" end end end
Verify that the given field does not contain the given value.
Verify that the given field does not contain the given value .
# Escape any problematic characters in the expected value # Match actual to expected
[Kelp::Unexpected] If the given field contains `value`
[ Kelp :: Unexpected ] If the given field contains ` value `
field
<not_specific>
value
<not_specific>
scope
<not_specific>
<not_specific>
scope Scoping keywords as understood by {#in_scope}
scope Scoping keywords as understood by { #in_scope }