File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
lib/capybara/active_admin/matchers Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,22 @@ def have_has_many_fields_for(association_name, options = {})
3232 selector = has_many_fields_selector ( association_name )
3333 have_selector ( selector , options )
3434 end
35+
36+ # @param text [String] button title
37+ # @param options [Hash]
38+ # @option selector [String, nil] optional selector to append
39+ # @option disabled [Boolean] button disabled or not (default false)
40+ # @example
41+ # expect(page).to have_submit_input('Submit') # check that submit input is present
42+ # expect(page).to have_submit_input('Submit', selector: '.custom-class') # check custom class presence
43+ # expect(page).to have_submit_input('Submit', disabled: true) # check that submit input is disabled
44+ # expect(page).to have_submit_input('Submit', disabled: true, count: 0) # check that submit input is enabled
45+ #
46+ def have_submit_input ( text , options = { } )
47+ selector = "#{ form_submit_selector ( text ) } #{ options . delete ( :selector ) } "
48+ selector += '[disabled="disabled"].disabled' if options . delete ( :disabled )
49+ have_selector ( selector , options )
50+ end
3551 end
3652 end
3753 end
You can’t perform that action at this time.
0 commit comments