Module: Chop::DSL
Instance Method Summary collapse
- #create!(klass, table, &block) ⇒ Object
- #diff!(selector, table, session: Capybara.current_session, as: nil, timeout: nil, **kwargs, &block) ⇒ Object
- #fill_in!(table) ⇒ Object
Instance Method Details
#create!(klass, table, &block) ⇒ Object
7 8 9 |
# File 'lib/chop/dsl.rb', line 7 def create! klass, table, &block Create.create! klass, table, &block end |
#diff!(selector, table, session: Capybara.current_session, as: nil, timeout: nil, **kwargs, &block) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/chop/dsl.rb', line 11 def diff! selector, table, session: Capybara.current_session, as: nil, timeout: nil, **kwargs, &block class_name = if as as.to_s elsif selector.respond_to?(:tag_name) selector.tag_name else session.find(selector).tag_name end.camelize klass = const_get("Chop::#{class_name}") kwargs[:session] = session kwargs[:timeout] = timeout if timeout.present? klass.diff! selector, table, **kwargs, &block end |