forked from mongoid/mongoid-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding extensions section, staring with the remarkable gem. Fixes mon…
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: Extensions | ||
author: Durran Jordan | ||
category: docs | ||
--- | ||
.title Remarkable | ||
.text | ||
%p | ||
Brian Cardarella's | ||
<a href="http://github.com/bcardarella/remarkable_mongoid">Remarkable</a> | ||
gem provides a nice addition of RSpec matchers for Mongoid. It contains | ||
the matchers shown below, plus all validation matchers from | ||
<a href="http://github.com/remarkable/remarkable/tree/master/remarkable_activemodel"> | ||
Remarkable::ActiveModel</a>. | ||
|
||
%pre | ||
%code.language-ruby | ||
:preserve | ||
describe Person do | ||
|
||
it { should reference_one :account } | ||
it { should reference_many :posts } | ||
it { should be_referenced_in :organization } | ||
it { should embed_one :name } | ||
it { should embed_many :addresses } | ||
it { should be_embedded_in :group } | ||
|
||
it { should validate_uniqueness_of :dob } | ||
end |
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