Module: Capybara::ActiveAdmin::Actions::Layout

Included in:
Capybara::ActiveAdmin::Actions
Defined in:
lib/capybara/active_admin/actions/layout.rb

Overview

Actions for common Active Admin components.

Instance Method Summary collapse

Instance Method Details

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



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

def click_action_item(title, options = {})
  within(action_items_container_selector) do
    click_link(title, options)
  end
end

#click_batch_action(title, exact: true) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/capybara/active_admin/actions/layout.rb', line 19

def click_batch_action(title, exact: true)
  open_batch_action_menu
  within(dropdown_list_selector) do
    selector = batch_action_selector
    opts = Util.options_with_text(title, exact: exact)
    find(selector, opts).click
  end
end

#confirm_modal_dialogObject



34
35
36
# File 'lib/capybara/active_admin/actions/layout.rb', line 34

def confirm_modal_dialog
  within_modal_dialog { click_button 'OK' }
end

#open_batch_action_menuObject



28
29
30
31
32
# File 'lib/capybara/active_admin/actions/layout.rb', line 28

def open_batch_action_menu
  return if find_all(dropdown_list_selector).present?

  find(batch_actions_button_selector).click
end

#switch_tab(tab_name, options = {}) ⇒ Object



14
15
16
17
# File 'lib/capybara/active_admin/actions/layout.rb', line 14

def switch_tab(tab_name, options = {})
  opts = Util.options_with_text(tab_name, options)
  find(tab_header_link_selector, opts).click
end