This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module FormTestHelper | |
| def assert_form(action, options = {}, &block) | |
| method = options.delete(:method) || :post | |
| if method == :put || method == :patch || method == :delete | |
| virtual_method, method = method, :post | |
| test_body = -> (*args) { | |
| assert_select "input[type='hidden'][name='_method']", | |
| value: virtual_method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'continuation' | |
| class Restart < RuntimeError | |
| attr_accessor :menu | |
| def initialize(**menu) | |
| @menu = menu | |
| @menu.each do |name, proc| | |
| define_singleton_method "#{name}!" do |
OlderNewer