Commit 019fed0f authored by Grzegorz Bizon's avatar Grzegorz Bizon

Reuse `no_cache_headers` method in badges controller

parent 4171933c
class Projects::BadgesController < Projects::ApplicationController class Projects::BadgesController < Projects::ApplicationController
before_action :set_no_cache before_action :no_cache_headers
def build def build
respond_to do |format| respond_to do |format|
...@@ -10,15 +10,4 @@ class Projects::BadgesController < Projects::ApplicationController ...@@ -10,15 +10,4 @@ class Projects::BadgesController < Projects::ApplicationController
end end
end 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 end
...@@ -21,7 +21,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps ...@@ -21,7 +21,7 @@ class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps
end end
step 'I should see a badge that has not been cached' do 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 end
def expect_badge(status) def expect_badge(status)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment