-
-
Save utkarshkukreti/912175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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