Module: Capybara::ActiveAdmin::Matchers::Table
- Defined in:
- lib/capybara/active_admin/matchers/table.rb
Instance Method Summary collapse
- #have_table(options = {}) ⇒ Object
- #have_table_cell(options = {}) ⇒ Object
- #have_table_header(text, options = {}) ⇒ Object
- #have_table_row(options = {}) ⇒ Object
- #have_table_scope(title = nil, selected: false, **options) ⇒ Object
- #have_table_scopes(options = {}) ⇒ Object
Instance Method Details
#have_table(options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/capybara/active_admin/matchers/table.rb', line 14 def have_table( = {}) resource_name = .delete(:resource_name) selector = table_selector(resource_name) have_selector(selector, **) end |
#have_table_cell(options = {}) ⇒ Object
50 51 52 53 54 55 |
# File 'lib/capybara/active_admin/matchers/table.rb', line 50 def have_table_cell( = {}) column = .delete(:column) selector = table_cell_selector(column) have_selector(selector, **) end |
#have_table_header(text, options = {}) ⇒ Object
87 88 89 90 91 |
# File 'lib/capybara/active_admin/matchers/table.rb', line 87 def have_table_header(text, = {}) selector = table_header_selector(text, ) opts = .except(:column, :sortable, :sort_direction).merge(exact_text: text) have_selector(selector, **opts) end |
#have_table_row(options = {}) ⇒ Object
30 31 32 33 34 |
# File 'lib/capybara/active_admin/matchers/table.rb', line 30 def have_table_row( = {}) row_id = .delete(:id) selector = table_row_selector(row_id) have_selector(selector, **) end |
#have_table_scope(title = nil, selected: false, **options) ⇒ Object
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/capybara/active_admin/matchers/table.rb', line 66 def have_table_scope(title = nil, selected: false, **) selector = "#{table_scopes_container_selector} > #{table_scope_selector}" if title.nil? selector = selected ? "#{selector}.selected" : "#{selector}:not(.selected)" have_selector(selector, **) else selector = selected ? "#{selector}.selected" : selector have_selector(selector, exact_text: title.to_s, **) end end |
#have_table_scopes(options = {}) ⇒ Object
59 60 61 |
# File 'lib/capybara/active_admin/matchers/table.rb', line 59 def have_table_scopes( = {}) have_selector("#{table_scopes_container_selector} > #{table_scope_selector}", **) end |