Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cancan
Manage
Activity
Members
Plan
External wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Github Mirror
coopdevs
cancan
Commits
ebb8e1bf
Commit
ebb8e1bf
authored
14 years ago
by
Mani Tadayon
Browse files
Options
Downloads
Patches
Plain Diff
Rename Mongoid collection used in spec and fix description for first spec
parent
4339ac65
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/cancan/mongoid_additions_spec.rb
+3
-3
3 additions, 3 deletions
spec/cancan/mongoid_additions_spec.rb
with
3 additions
and
3 deletions
spec/cancan/mongoid_additions_spec.rb
+
3
−
3
View file @
ebb8e1bf
...
...
@@ -34,7 +34,7 @@ class MongoidProject
end
Mongoid
.
configure
do
|
config
|
config
.
master
=
Mongo
::
Connection
.
new
(
'127.0.0.1'
,
27017
).
db
(
"
workflow_on_mongoid
"
)
config
.
master
=
Mongo
::
Connection
.
new
(
'127.0.0.1'
,
27017
).
db
(
"
cancan_mongoid_additions_spec
"
)
end
describe
CanCan
::
MongoidAdditions
do
...
...
@@ -50,7 +50,7 @@ describe CanCan::MongoidAdditions do
end
.
each
(
&
:drop
)
end
it
"should compare properties on mongoid documents with the "
do
it
"should compare properties on mongoid documents with the
conditions hash
"
do
model
=
@model_class
.
new
@ability
.
can
:read
,
@model_class
,
:id
=>
model
.
id
@ability
.
should
be_able_to
:read
,
model
...
...
@@ -100,7 +100,7 @@ describe CanCan::MongoidAdditions do
@conditions
=
{
:title
.
nin
=>
[
"Fork"
,
"Spoon"
]}
mock
(
@model_class
).
where
(
@conditions
)
{[
obj
]}
@ability
.
can
:read
,
@model_class
,
@conditions
@ability
.
can?
(
:read
,
obj
)
@ability
.
should
be_able_to
(
:read
,
obj
)
end
it
"Calls the base version if there are no mongoid criteria"
do
obj
=
@model_class
.
new
:title
=>
'Bird'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment