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
b3333dea
Commit
b3333dea
authored
Nov 27, 2020
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some keyword warnings in specs
parent
40f82832
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
spec/graphql/mutations/issues/update_spec.rb
spec/graphql/mutations/issues/update_spec.rb
+1
-1
spec/lib/backup/repositories_spec.rb
spec/lib/backup/repositories_spec.rb
+3
-1
spec/services/members/approve_access_request_service_spec.rb
spec/services/members/approve_access_request_service_spec.rb
+5
-5
No files found.
spec/graphql/mutations/issues/update_spec.rb
View file @
b3333dea
...
...
@@ -33,7 +33,7 @@ RSpec.describe Mutations::Issues::Update do
}.
merge
(
expected_attributes
)
end
subject
{
mutation
.
resolve
(
mutation_params
)
}
subject
{
mutation
.
resolve
(
**
mutation_params
)
}
it_behaves_like
'permission level for issue mutation is correctly verified'
...
...
spec/lib/backup/repositories_spec.rb
View file @
b3333dea
...
...
@@ -242,7 +242,9 @@ RSpec.describe Backup::Repositories do
# 4 times = project repo + wiki repo + project_snippet repo + personal_snippet repo
expect
(
Repository
).
to
receive
(
:new
).
exactly
(
4
).
times
.
and_wrap_original
do
|
method
,
*
original_args
|
repository
=
method
.
call
(
*
original_args
)
full_path
,
container
,
kwargs
=
original_args
repository
=
method
.
call
(
full_path
,
container
,
**
kwargs
)
expect
(
repository
).
to
receive
(
:remove
)
...
...
spec/services/members/approve_access_request_service_spec.rb
View file @
b3333dea
...
...
@@ -12,23 +12,23 @@ RSpec.describe Members::ApproveAccessRequestService do
shared_examples
'a service raising ActiveRecord::RecordNotFound'
do
it
'raises ActiveRecord::RecordNotFound'
do
expect
{
described_class
.
new
(
current_user
).
execute
(
access_requester
,
opts
)
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
expect
{
described_class
.
new
(
current_user
).
execute
(
access_requester
,
**
opts
)
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
end
end
shared_examples
'a service raising Gitlab::Access::AccessDeniedError'
do
it
'raises Gitlab::Access::AccessDeniedError'
do
expect
{
described_class
.
new
(
current_user
).
execute
(
access_requester
,
opts
)
}.
to
raise_error
(
Gitlab
::
Access
::
AccessDeniedError
)
expect
{
described_class
.
new
(
current_user
).
execute
(
access_requester
,
**
opts
)
}.
to
raise_error
(
Gitlab
::
Access
::
AccessDeniedError
)
end
end
shared_examples
'a service approving an access request'
do
it
'succeeds'
do
expect
{
described_class
.
new
(
current_user
).
execute
(
access_requester
,
opts
)
}.
to
change
{
source
.
requesters
.
count
}.
by
(
-
1
)
expect
{
described_class
.
new
(
current_user
).
execute
(
access_requester
,
**
opts
)
}.
to
change
{
source
.
requesters
.
count
}.
by
(
-
1
)
end
it
'returns a <Source>Member'
do
member
=
described_class
.
new
(
current_user
).
execute
(
access_requester
,
opts
)
member
=
described_class
.
new
(
current_user
).
execute
(
access_requester
,
**
opts
)
expect
(
member
).
to
be_a
"
#{
source
.
class
}
Member"
.
constantize
expect
(
member
.
requested_at
).
to
be_nil
...
...
@@ -36,7 +36,7 @@ RSpec.describe Members::ApproveAccessRequestService do
context
'with a custom access level'
do
it
'returns a ProjectMember with the custom access level'
do
member
=
described_class
.
new
(
current_user
,
access_level:
Gitlab
::
Access
::
MAINTAINER
).
execute
(
access_requester
,
opts
)
member
=
described_class
.
new
(
current_user
,
access_level:
Gitlab
::
Access
::
MAINTAINER
).
execute
(
access_requester
,
**
opts
)
expect
(
member
.
access_level
).
to
eq
(
Gitlab
::
Access
::
MAINTAINER
)
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