BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8b02d962
Commit
8b02d962
authored
Mar 01, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not require authentication for CI status badge
This changes only deprecated CI badge that we keep for backwards compatibility. See !3030#note_4041498.
parent
6be22dbb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
projects_controller.rb
app/controllers/ci/projects_controller.rb
+0
-1
projects_controller_spec.rb
spec/controllers/ci/projects_controller_spec.rb
+11
-12
No files found.
app/controllers/ci/projects_controller.rb
View file @
8b02d962
...
...
@@ -19,7 +19,6 @@ module Ci
#
def
badge
return
render_404
unless
@project
authenticate_user!
unless
@project
.
public?
image
=
Ci
::
ImageForBuildService
.
new
.
execute
(
@project
,
params
)
send_file
image
.
path
,
filename:
image
.
name
,
disposition:
'inline'
,
type
:"image/svg+xml"
...
...
spec/controllers/ci/projects_controller_spec.rb
View file @
8b02d962
...
...
@@ -9,6 +9,14 @@ describe Ci::ProjectsController do
# Specs for *deprecated* CI badge
#
describe
'#badge'
do
shared_examples
'badge provider'
do
it
'shows badge'
do
expect
(
response
.
status
).
to
eq
200
expect
(
response
.
headers
)
.
to
include
(
'Content-Type'
=>
'image/svg+xml'
)
end
end
context
'user not signed in'
do
before
{
get
(
:badge
,
id:
ci_id
)
}
...
...
@@ -22,18 +30,12 @@ describe Ci::ProjectsController do
context
'project is public'
do
let
(
:visibility
)
{
:public
}
it
'is available without authentication'
do
expect
(
response
.
status
).
to
eq
200
end
it_behaves_like
'badge provider'
end
context
'project is private'
do
let
(
:visibility
)
{
:private
}
it
'requires authentication'
do
expect
(
response
.
status
).
to
eq
302
end
it_behaves_like
'badge provider'
end
end
...
...
@@ -44,10 +46,7 @@ describe Ci::ProjectsController do
context
'private is internal'
do
let
(
:visibility
)
{
:internal
}
it
'shows badge to signed in user'
do
expect
(
response
.
status
).
to
eq
200
end
it_behaves_like
'badge provider'
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