Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ec437ad9
Commit
ec437ad9
authored
Feb 10, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more tests for FilteringService
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
56f989e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
spec/services/filtering_service_spec.rb
spec/services/filtering_service_spec.rb
+16
-0
No files found.
spec/services/filtering_service_spec.rb
View file @
ec437ad9
...
@@ -15,6 +15,7 @@ describe FilteringService do
...
@@ -15,6 +15,7 @@ describe FilteringService do
before
do
before
do
project1
.
team
<<
[
user
,
:master
]
project1
.
team
<<
[
user
,
:master
]
project2
.
team
<<
[
user
,
:developer
]
project2
.
team
<<
[
user
,
:developer
]
project2
.
team
<<
[
user2
,
:developer
]
end
end
describe
'merge requests'
do
describe
'merge requests'
do
...
@@ -61,5 +62,20 @@ describe FilteringService do
...
@@ -61,5 +62,20 @@ describe FilteringService do
issues
=
FilteringService
.
new
.
execute
(
Issue
,
user
,
params
)
issues
=
FilteringService
.
new
.
execute
(
Issue
,
user
,
params
)
issues
.
size
.
should
==
1
issues
.
size
.
should
==
1
end
end
it
'should be empty for unauthorized user'
do
params
=
{
scope:
"all"
,
state:
'opened'
}
issues
=
FilteringService
.
new
.
execute
(
Issue
,
nil
,
params
)
issues
.
size
.
should
be_zero
end
it
'should not include unauthorized issues'
do
params
=
{
scope:
"all"
,
state:
'opened'
}
issues
=
FilteringService
.
new
.
execute
(
Issue
,
user2
,
params
)
issues
.
size
.
should
==
2
issues
.
should_not
include
(
issue1
)
issues
.
should
include
(
issue2
)
issues
.
should
include
(
issue3
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment