Reuse `no_cache_headers` method in badges controller
This commit is contained in:
parent
4171933c09
commit
019fed0f72
|
@ -1,5 +1,5 @@
|
|||
class Projects::BadgesController < Projects::ApplicationController
|
||||
before_action :set_no_cache
|
||||
before_action :no_cache_headers
|
||||
|
||||
def build
|
||||
respond_to do |format|
|
||||
|
@ -10,15 +10,4 @@ class Projects::BadgesController < Projects::ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_no_cache
|
||||
expires_now
|
||||
|
||||
# Add some deprecated headers for older agents
|
||||
#
|
||||
response.headers['Pragma'] = 'no-cache'
|
||||
response.headers['Expires'] = 'Fri, 01 Jan 1990 00:00:00 GMT'
|
||||
end
|
||||
end
|
||||
|
|
|
@ -21,7 +21,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
step 'I should see a badge that has not been cached' do
|
||||
expect(page.response_headers).to include('Cache-Control' => 'no-cache')
|
||||
expect(page.response_headers['Cache-Control']).to include 'no-cache'
|
||||
end
|
||||
|
||||
def expect_badge(status)
|
||||
|
|
Loading…
Reference in New Issue