Permalink
Browse files

Added document found assertion

  • Loading branch information...
jnunemaker committed Sep 21, 2012
1 parent 6fb1b01 commit 80ed6deab25973f71a50e698e1fc846e9eb6bf31
Showing with 2 additions and 0 deletions.
  1. +2 −0 test/functional/test_modifiers.rb
@@ -25,6 +25,7 @@ def setup
def assert_page_counts(page, day_count, week_count, month_count)
doc = page.collection.find_one({:_id => page.id})
+ assert doc, "Could not find document with _id => #{page.id.inspect}"
doc.fetch('day_count').should == day_count
doc.fetch('week_count').should == week_count
doc.fetch('month_count').should == month_count
@@ -33,6 +34,7 @@ def assert_page_counts(page, day_count, week_count, month_count)
def assert_keys_removed(page, *keys)
keys.each do |key|
doc = page.class.collection.find_one({:_id => page.id})
+ assert doc, "Could not find document with _id => #{page.id.inspect}"
doc.keys.should_not include(key)
end
end

0 comments on commit 80ed6de

Please sign in to comment.