Feature #584

avatar

Ability to one or more create documents _with values_ from a hash

Added by Matt Zumwalt 265 days ago. Updated 265 days ago.

Status:New Start:11/06/2009
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:Convenience Spent time: -
Target version:-
Sponsor:


Description

This is especially useful for testing. For example, this cucumber step definition:
Given /^the following document:$/ do |documents|
  Document.create!(documents.hashes)
end
Where its being used in this way:
  Scenario: Delete frooble
    Given the following froobles:
      |name|color|description|
      |name 1|color 1|description 1|
      |name 2|color 2|description 2|
      |name 3|color 3|description 3|
      |name 4|color 4|description 4|
    When I delete the 3rd frooble
    Then I should see the following froobles:
      |Name|Color|Description|
      |name 1|color 1|description 1|
      |name 2|color 2|description 2|
      |name 4|color 4|description 4|

Also available in: Atom PDF