Module: Capybara::ActiveAdmin::Matchers::Layout

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

Overview

Matchers for common Active Admin components.

Instance Method Summary collapse

Instance Method Details

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



8
9
10
11
# File 'lib/capybara/active_admin/matchers/layout.rb', line 8

def have_action_item(text, options = {})
  opts = Util.options_with_text(text, options)
  have_selector(action_item_selector, opts)
end

#have_batch_action(title, exact: true) ⇒ Object



42
43
44
45
46
# File 'lib/capybara/active_admin/matchers/layout.rb', line 42

def have_batch_action(title, exact: true)
  selector = "#{dropdown_list_selector} #{batch_action_selector}"
  opts = Util.options_with_text(title, exact: exact)
  have_selector(selector, opts)
end

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



18
19
20
21
22
23
# File 'lib/capybara/active_admin/matchers/layout.rb', line 18

def have_flash_message(text, options = {})
  type = options.delete(:type)
  opts = Util.options_with_text(text, options)
  selector = flash_message_selector(type)
  have_selector(selector, opts)
end


25
26
27
28
# File 'lib/capybara/active_admin/matchers/layout.rb', line 25

def have_footer(options = {})
  selector = footer_selector
  have_selector(selector, options)
end

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



13
14
15
16
# File 'lib/capybara/active_admin/matchers/layout.rb', line 13

def have_page_title(text, options = {})
  opts = Util.options_with_text(text, options)
  have_selector(page_title_selector, opts)
end

#have_panel(title, options = {}) ⇒ Object



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

def have_panel(title, options = {})
  title_selector = "#{panel_selector} > #{panel_title_selector}"
  opts = Util.options_with_text(title, options)
  have_selector(title_selector, opts)
end

#have_sidebar(title, options = {}) ⇒ Object



36
37
38
39
40
# File 'lib/capybara/active_admin/matchers/layout.rb', line 36

def have_sidebar(title, options = {})
  title_selector = "#{sidebar_selector} #{panel_selector} > #{panel_title_selector}"
  opts = Util.options_with_text(title, options)
  have_selector(title_selector, opts)
end