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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4d675052
Commit
4d675052
authored
Jun 06, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing specs after project authorizations rework
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
61b861cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
spec/controllers/autocomplete_controller_spec.rb
spec/controllers/autocomplete_controller_spec.rb
+8
-8
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+1
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+2
-2
No files found.
spec/controllers/autocomplete_controller_spec.rb
View file @
4d675052
...
@@ -23,8 +23,8 @@ describe AutocompleteController do
...
@@ -23,8 +23,8 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
.
size
).
to
eq
2
}
it
{
expect
(
body
.
size
).
to
eq
3
}
it
{
expect
(
body
.
map
{
|
u
|
u
[
"username"
]
}).
to
match_array
([
user
.
username
,
user2
.
username
])
}
it
{
expect
(
body
.
map
{
|
u
|
u
[
"username"
]
}).
to
match_array
([
project
.
owner
.
username
,
user
.
username
,
user2
.
username
])
}
end
end
describe
'GET #users with unknown project'
do
describe
'GET #users with unknown project'
do
...
@@ -43,8 +43,8 @@ describe AutocompleteController do
...
@@ -43,8 +43,8 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
.
size
).
to
eq
1
}
it
{
expect
(
body
.
size
).
to
eq
2
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
it
{
expect
(
body
.
map
{
|
u
|
u
[
"username"
]
}).
to
match_array
([
project
.
owner
.
username
,
user
.
username
])
}
end
end
describe
"GET #users that can push code"
do
describe
"GET #users that can push code"
do
...
@@ -58,8 +58,8 @@ describe AutocompleteController do
...
@@ -58,8 +58,8 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
.
size
).
to
eq
2
}
it
{
expect
(
body
.
size
).
to
eq
3
}
it
{
expect
(
body
.
map
{
|
user
|
user
[
"username"
]
}).
to
match_array
([
user
.
username
,
user2
.
username
])
}
it
{
expect
(
body
.
map
{
|
user
|
user
[
"username"
]
}).
to
match_array
([
project
.
owner
.
username
,
user
.
username
,
user2
.
username
])
}
end
end
describe
"GET #users that can push to protected branches, including the current user"
do
describe
"GET #users that can push to protected branches, including the current user"
do
...
@@ -70,8 +70,8 @@ describe AutocompleteController do
...
@@ -70,8 +70,8 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
expect
(
body
.
size
).
to
eq
1
}
it
{
expect
(
body
.
size
).
to
eq
2
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
it
{
expect
(
body
.
map
{
|
u
|
u
[
"username"
]
}).
to
match_array
([
project
.
owner
.
username
,
user
.
username
])
}
end
end
end
end
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
4d675052
...
@@ -289,7 +289,7 @@ describe Projects::MergeRequestsController do
...
@@ -289,7 +289,7 @@ describe Projects::MergeRequestsController do
recorded
=
ActiveRecord
::
QueryRecorder
.
new
{
go
(
format: :json
)
}
recorded
=
ActiveRecord
::
QueryRecorder
.
new
{
go
(
format: :json
)
}
expect
(
recorded
.
count
).
to
be_within
(
5
).
of
(
95
)
expect
(
recorded
.
count
).
to
be_within
(
10
).
of
(
100
)
expect
(
recorded
.
cached_count
).
to
eq
(
0
)
expect
(
recorded
.
cached_count
).
to
eq
(
0
)
end
end
end
end
...
...
spec/models/merge_request_spec.rb
View file @
4d675052
...
@@ -564,7 +564,7 @@ describe MergeRequest, models: true do
...
@@ -564,7 +564,7 @@ describe MergeRequest, models: true do
project
.
team
<<
[
developer
,
:developer
]
project
.
team
<<
[
developer
,
:developer
]
project
.
team
<<
[
blocked_developer
,
:developer
]
project
.
team
<<
[
blocked_developer
,
:developer
]
expect
(
merge_request
.
number_of_potential_approvers
).
to
eq
(
1
)
expect
(
merge_request
.
number_of_potential_approvers
).
to
eq
(
2
)
end
end
context
"when the project is part of a group"
do
context
"when the project is part of a group"
do
...
@@ -1520,7 +1520,7 @@ describe MergeRequest, models: true do
...
@@ -1520,7 +1520,7 @@ describe MergeRequest, models: true do
end
end
it
'does not require approval for the merge request'
do
it
'does not require approval for the merge request'
do
expect
(
merge_request
.
approvals_left
).
to
eq
(
0
)
expect
(
merge_request
.
approvals_left
).
to
eq
(
1
)
end
end
it
'does not allow the approver to approve the MR'
do
it
'does not allow the approver to approve the MR'
do
...
...
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