Module: Capybara::ActiveAdmin::Matchers::Form

Included in:
Capybara::ActiveAdmin::Matchers
Defined in:
lib/capybara/active_admin/matchers/form.rb

Instance Method Summary collapse

Instance Method Details

#have_form_error(text, options = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/capybara/active_admin/matchers/form.rb', line 7

def have_form_error(text, options = {})
  field = options.delete(:field)
  opts = Util.options_with_text(text, options)
  li_selector = input_container_selector field, options.slice(:exact)

  have_selector("#{li_selector} #{inline_error_selector}", opts)
end

#have_has_many_fields_for(association_name, options = {}) ⇒ Object



31
32
33
34
# File 'lib/capybara/active_admin/matchers/form.rb', line 31

def have_has_many_fields_for(association_name, options = {})
  selector = has_many_fields_selector(association_name)
  have_selector(selector, options)
end

#have_no_form_errors(options = {}) ⇒ Object



15
16
17
18
19
20
# File 'lib/capybara/active_admin/matchers/form.rb', line 15

def have_no_form_errors(options = {})
  field = options.delete(:field)
  li_selector = input_container_selector field, options.slice(:exact)

  have_none_of_selectors(:css, "#{li_selector} #{inline_error_selector}", options)
end

#have_semantic_error(text, options = {}) ⇒ Object



22
23
24
25
# File 'lib/capybara/active_admin/matchers/form.rb', line 22

def have_semantic_error(text, options = {})
  opts = Util.options_with_text(text, options)
  have_selector(semantic_error_selector, opts)
end

#have_semantic_errors(options = {}) ⇒ Object



27
28
29
# File 'lib/capybara/active_admin/matchers/form.rb', line 27

def have_semantic_errors(options = {})
  have_selector(semantic_error_selector, options)
end