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
Léo-Paul Géneau
gitlab-ce
Commits
86cda964
Commit
86cda964
authored
Jan 21, 2019
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed static analysis error and 2 caching specs
parent
5fc63a1d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/controllers/uploads_controller.rb
app/controllers/uploads_controller.rb
+1
-1
spec/controllers/uploads_controller_spec.rb
spec/controllers/uploads_controller_spec.rb
+5
-5
No files found.
app/controllers/uploads_controller.rb
View file @
86cda964
...
@@ -71,7 +71,7 @@ class UploadsController < ApplicationController
...
@@ -71,7 +71,7 @@ class UploadsController < ApplicationController
end
end
def
cache_privately?
def
cache_privately?
true
unless
(
User
===
model
||
Appearance
===
model
)
true
unless
User
===
model
||
Appearance
===
model
end
end
def
upload_model_class
def
upload_model_class
...
...
spec/controllers/uploads_controller_spec.rb
View file @
86cda964
...
@@ -12,7 +12,7 @@ shared_examples 'content not cached without revalidation and no-store' do
...
@@ -12,7 +12,7 @@ shared_examples 'content not cached without revalidation and no-store' do
end
end
end
end
shared_examples
'content publicy cached'
do
shared_examples
'content public
l
y cached'
do
it
'ensures content is publicly cached'
do
it
'ensures content is publicly cached'
do
# Fixed in newer versions of ActivePack, it will only output a single `private`.
# Fixed in newer versions of ActivePack, it will only output a single `private`.
expect
(
subject
[
'Cache-Control'
]).
to
eq
(
'max-age=300, public'
)
expect
(
subject
[
'Cache-Control'
]).
to
eq
(
'max-age=300, public'
)
...
@@ -191,7 +191,7 @@ describe UploadsController do
...
@@ -191,7 +191,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content publicy cached'
do
it_behaves_like
'content public
l
y cached'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'user'
,
mounted_as:
'avatar'
,
id:
user
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'user'
,
mounted_as:
'avatar'
,
id:
user
.
id
,
filename:
'dk.png'
}
...
@@ -208,7 +208,7 @@ describe UploadsController do
...
@@ -208,7 +208,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content
not cached without revalidation
'
do
it_behaves_like
'content
publicly cached
'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'user'
,
mounted_as:
'avatar'
,
id:
user
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'user'
,
mounted_as:
'avatar'
,
id:
user
.
id
,
filename:
'dk.png'
}
...
@@ -544,7 +544,7 @@ describe UploadsController do
...
@@ -544,7 +544,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content
not cached without revalidation
'
do
it_behaves_like
'content
publicly cached
'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'appearance'
,
mounted_as:
'header_logo'
,
id:
appearance
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'appearance'
,
mounted_as:
'header_logo'
,
id:
appearance
.
id
,
filename:
'dk.png'
}
...
@@ -564,7 +564,7 @@ describe UploadsController do
...
@@ -564,7 +564,7 @@ describe UploadsController do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
end
it_behaves_like
'content
not cached without revalidation
'
do
it_behaves_like
'content
publicly cached
'
do
subject
do
subject
do
get
:show
,
params:
{
model:
'appearance'
,
mounted_as:
'logo'
,
id:
appearance
.
id
,
filename:
'dk.png'
}
get
:show
,
params:
{
model:
'appearance'
,
mounted_as:
'logo'
,
id:
appearance
.
id
,
filename:
'dk.png'
}
...
...
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