Class: Chop::Form
- Inherits:
-
Struct
- Object
- Struct
- Chop::Form
- Defined in:
- lib/chop/form.rb
Defined Under Namespace
Classes: Checkbox, Default, Field, MultipleCheckbox, MultipleFile, MultipleSelect, Radio, Select, SingleFile
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#session ⇒ Object
Returns the value of attribute session.
-
#table ⇒ Object
Returns the value of attribute table.
Class Method Summary collapse
- .diff!(selector, table, session: Capybara.current_session, &block) ⇒ Object
- .fill_in!(table, session: Capybara.current_session, path: "features/support/fixtures") ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path
5 6 7 |
# File 'lib/chop/form.rb', line 5 def path @path end |
#session ⇒ Object
Returns the value of attribute session
5 6 7 |
# File 'lib/chop/form.rb', line 5 def session @session end |
#table ⇒ Object
Returns the value of attribute table
5 6 7 |
# File 'lib/chop/form.rb', line 5 def table @table end |
Class Method Details
.diff!(selector, table, session: Capybara.current_session, &block) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/chop/form.rb', line 10 def self.diff! selector, table, session: Capybara.current_session, &block actual = session.find("form").all("input, textarea, select").map do |field| [field.label, field.value] end table.diff! actual, surplus_row: false end |
.fill_in!(table, session: Capybara.current_session, path: "features/support/fixtures") ⇒ Object
6 7 8 |
# File 'lib/chop/form.rb', line 6 def self.fill_in! table, session: Capybara.current_session, path: "features/support/fixtures" new(table, session, path).fill_in! end |