Skip to content

Commit

Permalink
Added step to assert size of an association (e.g. Then the user shoul…
Browse files Browse the repository at this point in the history
…d have 4 friends)
  • Loading branch information
ianwhite committed Apr 27, 2010
1 parent e79c0d3 commit fc9e8a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 4 additions & 2 deletions History.txt
@@ -1,10 +1,12 @@
== 0.2.9 - 27 Apr 2010
== 0.2.9 - 27 Apr 2010 (the #railscamp7 release)

* 4 minor improvements
* 5 improvements
* Fixed problem with verifying model attribute using strings with escaped quotes [Michael MacDonald]
* Added handling for positive and negative floats [Michael MacDonald, #railscamp7]
* Added handling of ruby integer syntax (e.g. 1_000_000) [Ian White]
* Modified the way pickle handles predicates to match rspec [Michael MacDonald, #railscamp7]
* Added step to assert size of an association (e.g. Then the user should have 4 friends) [Ian White]


== 0.2.8 - 5 Apr 2010

Expand Down
4 changes: 4 additions & 0 deletions features/pickle/create_from_factory_girl.feature
Expand Up @@ -46,8 +46,12 @@ Feature: I can easily create models from my factories
| fork |
| the 1st fork |
| the 2nd fork |
| the 2nd fork |
Then the 1st tine should be in the 1st fork's tines
And the 2nd tine should be in the 2nd fork's tines
And the 3rd tine should be in the 2nd fork's tines
And the 1st fork should have 1 tines
And the 2nd fork should have 2 tines

Scenario: I create fork via a mapping
Given killah fork exists
Expand Down
5 changes: 5 additions & 0 deletions rails_generators/pickle/templates/pickle_steps.rb
Expand Up @@ -93,3 +93,8 @@
actual_value.to_s.send(expectation, eql(eval(expected)))
end
end

# assert size of association
Then /^#{capture_model} should have (\d+) (\w+)$/ do |name, size, association|
model!(name).send(association).size.should == size.to_i
end

0 comments on commit fc9e8a7

Please sign in to comment.