Method: RSpec::Matchers#with_date_field

Defined in:
lib/rspec-html-matchers.rb

- (Object) with_date_field(date_field_type, name = nil, options = {})



367
368
369
370
371
372
373
# File 'lib/rspec-html-matchers.rb', line 367

def with_date_field date_field_type, name=nil, options={}
  date_field_type = date_field_type.to_s
  raise "unknown type `#{date_field_type}` for date picker" unless DATE_FIELD_TYPES.include?(date_field_type)
  options = { :with => { :type => date_field_type.to_s }.merge(options.delete(:with)||{}) }
  options[:with].merge!(:name => name.to_s) if name
  should_have_input(options)
end

Comments