Permalink
Browse files

Change assert keys removed to just take document

  • Loading branch information...
1 parent 17badd6 commit 6fb1b018a5fe871e4e64b459a812b51cb36e26a7 @jnunemaker jnunemaker committed Sep 21, 2012
Showing with 7 additions and 7 deletions.
  1. +7 −7 test/functional/test_modifiers.rb
@@ -30,9 +30,9 @@ def assert_page_counts(page, day_count, week_count, month_count)
doc.fetch('month_count').should == month_count
end
- def assert_keys_removed(page_class, page, *keys)
+ def assert_keys_removed(page, *keys)
keys.each do |key|
- doc = page_class.collection.find_one({:_id => page.id})
+ doc = page.class.collection.find_one({:_id => page.id})
doc.keys.should_not include(key)
end
end
@@ -50,14 +50,14 @@ def assert_keys_removed(page_class, page, *keys)
should "work with criteria and keys" do
@page_class.unset({:title => 'Home'}, :title, :tags)
- assert_keys_removed @page_class, @page, :title, :tags
- assert_keys_removed @page_class, @page2, :title, :tags
+ assert_keys_removed @page, :title, :tags
+ assert_keys_removed @page2, :title, :tags
end
should "work with ids and keys" do
@page_class.unset(@page.id, @page2.id, :title, :tags)
- assert_keys_removed @page_class, @page, :title, :tags
- assert_keys_removed @page_class, @page2, :title, :tags
+ assert_keys_removed @page, :title, :tags
+ assert_keys_removed @page2, :title, :tags
end
context "additional options (upsert & safe)" do
@@ -433,7 +433,7 @@ def assert_keys_removed(page_class, page, *keys)
should "be able to unset with keys" do
page = @page_class.create(:title => 'Foo', :tags => %w(foo))
page.unset(:title, :tags)
- assert_keys_removed @page_class, page, :title, :tags
+ assert_keys_removed page, :title, :tags
end
should "be able to increment with modifier hashes" do

0 comments on commit 6fb1b01

Please sign in to comment.