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
9c3f276b
Commit
9c3f276b
authored
Apr 22, 2020
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for RSpec/LeakyConstantDeclaration
parent
ce588f38
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
9 deletions
+8
-9
.rubocop.yml
.rubocop.yml
+0
-1
qa/spec/factory/resource/user_spec.rb
qa/spec/factory/resource/user_spec.rb
+4
-4
qa/spec/git/repository_spec.rb
qa/spec/git/repository_spec.rb
+4
-4
No files found.
.rubocop.yml
View file @
9c3f276b
...
...
@@ -329,7 +329,6 @@ RSpec/LeakyConstantDeclaration:
Enabled
:
true
Exclude
:
-
'
spec/**/*.rb'
-
'
qa/spec/**/*.rb'
RSpec/EmptyLineAfterHook
:
Enabled
:
false
...
...
qa/spec/factory/resource/user_spec.rb
View file @
9c3f276b
...
...
@@ -2,7 +2,7 @@
describe
QA
::
Resource
::
User
do
describe
"#fabricate_via_api!"
do
R
esponse
=
Struct
.
new
(
:code
,
:body
)
r
esponse
=
Struct
.
new
(
:code
,
:body
)
it
'fetches an existing user'
do
existing_users
=
[
...
...
@@ -13,8 +13,8 @@ describe QA::Resource::User do
web_url:
''
}
]
users_response
=
R
esponse
.
new
(
'200'
,
JSON
.
dump
(
existing_users
))
single_user_response
=
R
esponse
.
new
(
'200'
,
JSON
.
dump
(
existing_users
.
first
))
users_response
=
r
esponse
.
new
(
'200'
,
JSON
.
dump
(
existing_users
))
single_user_response
=
r
esponse
.
new
(
'200'
,
JSON
.
dump
(
existing_users
.
first
))
expect
(
subject
).
to
receive
(
:api_get_from
).
with
(
"/users?username=name"
).
and_return
(
users_response
)
expect
(
subject
).
to
receive
(
:api_get_from
).
with
(
"/users/0"
).
and_return
(
single_user_response
)
...
...
@@ -26,7 +26,7 @@ describe QA::Resource::User do
end
it
'tries to create a user if it does not exist'
do
expect
(
subject
).
to
receive
(
:api_get_from
).
with
(
"/users?username=foo"
).
and_return
(
R
esponse
.
new
(
'200'
,
'[]'
))
expect
(
subject
).
to
receive
(
:api_get_from
).
with
(
"/users?username=foo"
).
and_return
(
r
esponse
.
new
(
'200'
,
'[]'
))
expect
(
subject
).
to
receive
(
:api_post
).
and_return
({
web_url:
''
})
subject
.
username
=
'foo'
...
...
qa/spec/git/repository_spec.rb
View file @
9c3f276b
...
...
@@ -69,20 +69,20 @@ describe QA::Git::Repository do
end
describe
'#fetch_supported_git_protocol'
do
R
esult
=
Struct
.
new
(
:response
)
r
esult
=
Struct
.
new
(
:response
)
it
"reports the detected version"
do
expect
(
repository
).
to
receive
(
:run
).
and_return
(
R
esult
.
new
(
"packet: git< version 2"
))
expect
(
repository
).
to
receive
(
:run
).
and_return
(
r
esult
.
new
(
"packet: git< version 2"
))
expect
(
repository
.
fetch_supported_git_protocol
).
to
eq
(
'2'
)
end
it
'reports unknown if version is unknown'
do
expect
(
repository
).
to
receive
(
:run
).
and_return
(
R
esult
.
new
(
"packet: git< version -1"
))
expect
(
repository
).
to
receive
(
:run
).
and_return
(
r
esult
.
new
(
"packet: git< version -1"
))
expect
(
repository
.
fetch_supported_git_protocol
).
to
eq
(
'unknown'
)
end
it
'reports unknown if content does not identify a version'
do
expect
(
repository
).
to
receive
(
:run
).
and_return
(
R
esult
.
new
(
"foo"
))
expect
(
repository
).
to
receive
(
:run
).
and_return
(
r
esult
.
new
(
"foo"
))
expect
(
repository
.
fetch_supported_git_protocol
).
to
eq
(
'unknown'
)
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