diff options
author | Starfall <us@starfall.systems> | 2020-07-23 16:25:58 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2020-07-23 16:25:58 -0500 |
commit | 2b41ed0fd69a7f7a0e17d6f0c6a421805c5e3127 (patch) | |
tree | a3ab43415b061112bc614205a3bb96bb9718bbd0 /spec/controllers/statuses_controller_spec.rb | |
parent | e3d96a9bc62f57d60dc21906b4b803e346b0a738 (diff) | |
parent | 16416e940fd803af92377eee9a1756ef27eed199 (diff) |
Merge branch 'glitch' into main
Diffstat (limited to 'spec/controllers/statuses_controller_spec.rb')
-rw-r--r-- | spec/controllers/statuses_controller_spec.rb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb index ba1f1370a..cd6e1e607 100644 --- a/spec/controllers/statuses_controller_spec.rb +++ b/spec/controllers/statuses_controller_spec.rb @@ -5,6 +5,21 @@ require 'rails_helper' describe StatusesController do render_views + shared_examples 'cachable response' do + it 'does not set cookies' do + expect(response.cookies).to be_empty + expect(response.headers['Set-Cookies']).to be nil + end + + it 'does not set sessions' do + expect(session).to be_empty + end + + it 'returns public Cache-Control header' do + expect(response.headers['Cache-Control']).to include 'public' + end + end + describe 'GET #show' do let(:account) { Fabricate(:account) } let(:status) { Fabricate(:status, account: account) } @@ -80,9 +95,7 @@ describe StatusesController do expect(response.headers['Vary']).to eq 'Accept' end - it 'returns public Cache-Control header' do - expect(response.headers['Cache-Control']).to include 'public' - end + it_behaves_like 'cachable response' it 'returns Content-Type header' do expect(response.headers['Content-Type']).to include 'application/activity+json' @@ -470,9 +483,7 @@ describe StatusesController do expect(response.headers['Vary']).to eq 'Accept' end - it 'returns public Cache-Control header' do - expect(response.headers['Cache-Control']).to include 'public' - end + it_behaves_like 'cachable response' it 'returns Content-Type header' do expect(response.headers['Content-Type']).to include 'application/activity+json' |