Skip to content

Instantly share code, notes, and snippets.

@utkarshkukreti
Forked from anonymous/books
Created April 10, 2011 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save utkarshkukreti/912175 to your computer and use it in GitHub Desktop.
Save utkarshkukreti/912175 to your computer and use it in GitHub Desktop.
def setup()
Mongoid.configure do |config|
config.master = Mongo::Connection.new.db("testbooks")
end
@book = Books.create(title: 'Turn of a Screw', author: "Henry James", barcode: '666')
end
def test_barcode
# Test for uniqueness of each book barcode
# Compare to whole, must not match any
assert_equal(@book, Books.where(author: 'Henry James').first)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment