Skip to content

Commit

Permalink
Added additional collection tests
Browse files Browse the repository at this point in the history
To test both scoped and unscoped code paths

See fog#352 for more context
  • Loading branch information
Temikus committed Jul 22, 2018
1 parent 3ad01e6 commit 1d59654
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/helpers/test_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ def test_lifecycle
assert_includes @subject.all.map(&:identity), one.identity
assert_includes @subject.all.map(&:identity), two.identity

assert_equal one.identity, @factory.get(one.identity).identity
assert_equal two.identity, @factory.get(two.identity).identity
assert_equal one.identity, @subject.get(one.identity).identity
assert_equal two.identity, @subject.get(two.identity).identity

# Some factories that have scoped parameters (zone, region) have a special
# `get` method defined in the factory to pass the correct parameters in
if @factory.respond_to?(:get)
assert_equal one.identity, @factory.get(one.identity).identity
assert_equal two.identity, @factory.get(two.identity).identity
end

one.destroy
two.destroy
Expand Down

0 comments on commit 1d59654

Please sign in to comment.