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
Tatuya Kamada
gitlab-ce
Commits
81510b46
Commit
81510b46
authored
Apr 17, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature specs for raw trace
parent
bf4371d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
app/controllers/projects/builds_controller.rb
app/controllers/projects/builds_controller.rb
+1
-1
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+1
-1
spec/features/builds_spec.rb
spec/features/builds_spec.rb
+26
-0
No files found.
app/controllers/projects/builds_controller.rb
View file @
81510b46
...
@@ -63,7 +63,7 @@ class Projects::BuildsController < Projects::ApplicationController
...
@@ -63,7 +63,7 @@ class Projects::BuildsController < Projects::ApplicationController
end
end
def
raw
def
raw
response
.
headers
[
'Content-Type
i'
]
=
'text/plain
'
response
.
headers
[
'Content-Type
'
]
=
'text/plain; charset=utf-8
'
if
@build
.
has_trace?
if
@build
.
has_trace?
response
.
headers
[
'X-Sendfile'
]
=
@build
.
path_to_trace
response
.
headers
[
'X-Sendfile'
]
=
@build
.
path_to_trace
else
else
...
...
app/views/projects/builds/show.html.haml
View file @
81510b46
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
=
icon
(
'folder-open'
)
=
icon
(
'folder-open'
)
Browse
Browse
.build-widget
.build-widget
.build-controls
%h4
.title
%h4
.title
Build ##{@build.id}
Build ##{@build.id}
-
if
can?
(
current_user
,
:update_build
,
@project
)
-
if
can?
(
current_user
,
:update_build
,
@project
)
...
...
spec/features/builds_spec.rb
View file @
81510b46
...
@@ -86,6 +86,20 @@ describe "Builds" do
...
@@ -86,6 +86,20 @@ describe "Builds" do
end
end
end
end
end
end
context
'Build raw trace'
do
before
do
@build
.
run!
@build
.
trace
=
'BUILD TRACE'
visit
namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
)
end
it
do
page
.
within
(
'.build-controls'
)
do
expect
(
page
).
to
have_content
'Raw'
end
end
end
end
end
describe
"POST /:project/builds/:id/cancel"
do
describe
"POST /:project/builds/:id/cancel"
do
...
@@ -120,4 +134,16 @@ describe "Builds" do
...
@@ -120,4 +134,16 @@ describe "Builds" do
it
{
expect
(
page
.
response_headers
[
'Content-Type'
]).
to
eq
(
artifacts_file
.
content_type
)
}
it
{
expect
(
page
.
response_headers
[
'Content-Type'
]).
to
eq
(
artifacts_file
.
content_type
)
}
end
end
describe
"GET /:project/builds/:id/raw"
do
before
do
@build
.
run!
@build
.
trace
=
'BUILD TRACE'
visit
namespace_project_build_path
(
@project
.
namespace
,
@project
,
@build
)
page
.
within
(
'.build-controls'
)
{
click_link
'Raw'
}
end
it
{
expect
(
page
.
response_headers
[
'Content-Type'
]).
to
eq
(
'text/plain; charset=utf-8'
)
}
it
{
expect
(
page
.
response_headers
[
'X-Sendfile'
]).
to
eq
(
@build
.
path_to_trace
)
}
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