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
3901cbe4
Commit
3901cbe4
authored
14 years ago
by
Ryan Bates
Browse files
Options
Downloads
Patches
Plain Diff
fixing tests for passing action name through to accessible_by call
parent
471d54ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/cancan/controller_resource_spec.rb
+1
-1
1 addition, 1 deletion
spec/cancan/controller_resource_spec.rb
spec/cancan/inherited_resource_spec.rb
+1
-1
1 addition, 1 deletion
spec/cancan/inherited_resource_spec.rb
with
2 additions
and
2 deletions
spec/cancan/controller_resource_spec.rb
+
1
−
1
View file @
3901cbe4
...
@@ -67,7 +67,7 @@ describe CanCan::ControllerResource do
...
@@ -67,7 +67,7 @@ describe CanCan::ControllerResource do
end
end
it
"should build a collection when on index action when class responds to accessible_by"
do
it
"should build a collection when on index action when class responds to accessible_by"
do
stub
(
Project
).
accessible_by
(
@ability
)
{
:found_projects
}
stub
(
Project
).
accessible_by
(
@ability
,
:index
)
{
:found_projects
}
@params
[
:action
]
=
"index"
@params
[
:action
]
=
"index"
resource
=
CanCan
::
ControllerResource
.
new
(
@controller
,
:project
)
resource
=
CanCan
::
ControllerResource
.
new
(
@controller
,
:project
)
resource
.
load_resource
resource
.
load_resource
...
...
This diff is collapsed.
Click to expand it.
spec/cancan/inherited_resource_spec.rb
+
1
−
1
View file @
3901cbe4
...
@@ -34,7 +34,7 @@ describe CanCan::InheritedResource do
...
@@ -34,7 +34,7 @@ describe CanCan::InheritedResource do
it
"index should load through @controller.end_of_association_chain"
do
it
"index should load through @controller.end_of_association_chain"
do
@params
[
:action
]
=
"index"
@params
[
:action
]
=
"index"
stub
(
Project
).
accessible_by
(
@ability
)
{
:projects
}
stub
(
Project
).
accessible_by
(
@ability
,
:index
)
{
:projects
}
stub
(
@controller
).
end_of_association_chain
{
Project
}
stub
(
@controller
).
end_of_association_chain
{
Project
}
CanCan
::
InheritedResource
.
new
(
@controller
).
load_resource
CanCan
::
InheritedResource
.
new
(
@controller
).
load_resource
@controller
.
instance_variable_get
(
:@projects
).
should
==
:projects
@controller
.
instance_variable_get
(
:@projects
).
should
==
:projects
...
...
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