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
0a1fb9ce
Commit
0a1fb9ce
authored
Oct 24, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CE->EE] Fix wrong resolvation of specs
parent
53e98ffd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
68 deletions
+3
-68
spec/controllers/projects/issues_controller_spec.rb
spec/controllers/projects/issues_controller_spec.rb
+3
-41
spec/requests/api/jobs_spec.rb
spec/requests/api/jobs_spec.rb
+0
-13
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+0
-5
spec/requests/api/v3/builds_spec.rb
spec/requests/api/v3/builds_spec.rb
+0
-9
No files found.
spec/controllers/projects/issues_controller_spec.rb
View file @
0a1fb9ce
...
...
@@ -862,36 +862,10 @@ describe Projects::IssuesController do
expect
(
json_response
.
first
.
keys
).
to
match_array
(
%w[id reply_id expanded notes individual_note]
)
end
context
'with cross-reference system note'
,
:request_store
do
let
(
:new_issue
)
{
create
(
:issue
)
}
let
(
:cross_reference
)
{
"mentioned in
#{
new_issue
.
to_reference
(
issue
.
project
)
}
"
}
before
do
create
(
:discussion_note_on_issue
,
:system
,
noteable:
issue
,
project:
issue
.
project
,
note:
cross_reference
)
end
it
'filters notes that the user should not see'
do
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
expect
(
JSON
.
parse
(
response
.
body
).
count
).
to
eq
(
1
)
end
it
'does not result in N+1 queries'
do
# Instantiate the controller variables to ensure QueryRecorder has an accurate base count
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
RequestStore
.
clear!
control_count
=
ActiveRecord
::
QueryRecorder
.
new
do
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
end
.
count
RequestStore
.
clear!
create_list
(
:discussion_note_on_issue
,
2
,
:system
,
noteable:
issue
,
project:
issue
.
project
,
note:
cross_reference
)
it
'filters notes that the user should not see'
do
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
expect
{
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
}.
not_to
exceed_query_limit
(
control_count
)
end
expect
(
JSON
.
parse
(
response
.
body
).
count
).
to
eq
(
1
)
end
end
...
...
@@ -953,12 +927,6 @@ describe Projects::IssuesController do
it_behaves_like
'user cannot see confidential issue'
,
Gitlab
::
Access
::
NO_ACCESS
end
it
'returns discussion json'
do
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
expect
(
json_response
.
first
.
keys
).
to
match_array
(
%w[id reply_id expanded notes individual_note]
)
end
context
'with cross-reference system note'
,
:request_store
do
let
(
:new_issue
)
{
create
(
:issue
)
}
let
(
:cross_reference
)
{
"mentioned in
#{
new_issue
.
to_reference
(
issue
.
project
)
}
"
}
...
...
@@ -967,12 +935,6 @@ describe Projects::IssuesController do
create
(
:discussion_note_on_issue
,
:system
,
noteable:
issue
,
project:
issue
.
project
,
note:
cross_reference
)
end
it
'filters notes that the user should not see'
do
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
expect
(
JSON
.
parse
(
response
.
body
).
count
).
to
eq
(
1
)
end
it
'does not result in N+1 queries'
do
# Instantiate the controller variables to ensure QueryRecorder has an accurate base count
get
:discussions
,
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
issue
.
iid
...
...
spec/requests/api/jobs_spec.rb
View file @
0a1fb9ce
...
...
@@ -320,12 +320,6 @@ describe API::Jobs do
it
'does not return job artifacts if not uploaded'
do
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
it
'returns specific job artifacts'
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
.
headers
).
to
include
(
download_headers
)
expect
(
response
.
body
).
to
match_file
(
job
.
artifacts_file
.
file
.
file
)
end
end
end
...
...
@@ -360,10 +354,6 @@ describe API::Jobs do
end
end
end
it
'does not return job artifacts if not uploaded'
do
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
end
describe
'GET /projects/:id/artifacts/:ref_name/download?job=name'
do
...
...
@@ -446,9 +436,6 @@ describe API::Jobs do
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
it
{
expect
(
response
.
headers
).
to
include
(
download_headers
)
}
end
context
'with regular branch'
do
...
...
spec/requests/api/runner_spec.rb
View file @
0a1fb9ce
...
...
@@ -1188,11 +1188,6 @@ describe API::Runner do
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
end
it
'download artifacts'
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
.
headers
).
to
include
download_headers
end
end
context
'when using runnners token'
do
...
...
spec/requests/api/v3/builds_spec.rb
View file @
0a1fb9ce
...
...
@@ -220,12 +220,6 @@ describe API::V3::Builds do
it
'returns location redirect'
do
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
it
'returns specific job artifacts'
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
.
headers
).
to
include
(
download_headers
)
expect
(
response
.
body
).
to
match_file
(
build
.
artifacts_file
.
file
.
file
)
end
end
context
'unauthorized user'
do
...
...
@@ -321,9 +315,6 @@ describe API::V3::Builds do
expect
(
response
).
to
have_gitlab_http_status
(
302
)
end
end
it
{
expect
(
response
).
to
have_gitlab_http_status
(
200
)
}
it
{
expect
(
response
.
headers
).
to
include
(
download_headers
)
}
end
context
'with regular branch'
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