Module: Chop::DSL

Included in:
Chop
Defined in:
lib/chop/dsl.rb

Instance Method Summary collapse

Instance Method Details

#create!(klass, table, &block) ⇒ Object



5
6
7
# File 'lib/chop/dsl.rb', line 5

def create! klass, table, &block
  Create.create! klass, table, &block
end

#diff!(selector, table, session: Capybara.current_session, as: nil, &block) ⇒ Object



9
10
11
12
13
# File 'lib/chop/dsl.rb', line 9

def diff! selector, table, session: Capybara.current_session, as: nil, &block
  class_name = as ? as.to_s.camelize : session.find(selector).tag_name.camelize
  klass = const_get("Chop::#{class_name}")
  klass.diff! selector, table, session: session, &block
end

#fill_in!(table) ⇒ Object



15
16
17
# File 'lib/chop/dsl.rb', line 15

def fill_in! table
  Form.fill_in! table
end