File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
lib/capybara/active_admin Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,24 @@ def have_table_cell(options = {})
5353
5454 have_selector ( selector , options )
5555 end
56+
57+ # @param options [Hash]
58+ # @option count [Integer] qty of nodes
59+ def have_table_scopes ( options = { } )
60+ have_selector ( "#{ table_scopes_container_selector } > #{ table_scope_selector } " , options )
61+ end
62+
63+ # @param options [Hash]
64+ # @option exact_text [String] title of scope
65+ # @option counter [Integer,String,nil] counter value in brackets (nil if skipped)
66+ # @option selected [Boolean] is scope active (default false)
67+ def have_table_scope ( options = { } )
68+ active = options . delete ( :active )
69+ selector = "#{ table_scopes_container_selector } > #{ table_scope_selector } "
70+ selector = active ? "#{ selector } .selected" : "#{ selector } :not(.selected)"
71+
72+ have_selector ( selector , options )
73+ end
5674 end
5775 end
5876 end
Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ def table_cell_selector(column = nil)
3535 column = column . to_s . gsub ( ' ' , '_' ) . downcase
3636 "td.col.col-#{ column } "
3737 end
38+
39+ def table_scopes_container_selector
40+ '.scopes > ul.table_tools_segmented_control'
41+ end
42+
43+ def table_scope_selector
44+ 'li.scope'
45+ end
3846 end
3947 end
4048 end
You can’t perform that action at this time.
0 commit comments