spec/requests/locomotive/steam/cache_spec.rb in locomotivecms-3.3.0.rc1 vs spec/requests/locomotive/steam/cache_spec.rb in locomotivecms-3.3.0.rc2

- old
+ new

@@ -6,11 +6,11 @@ let(:page_cache) { false } let(:site) { instance_double('CacheSite', _id: '0001', cache_enabled: site_cache, last_modified_at: DateTime.parse('2007/06/29 00:00:00')) } let(:page) { instance_double('CachedPage', _id: '0042', cache_enabled: page_cache, redirect_url: nil) } let(:app) { ->(env) { [200, env, 'app'] } } let(:middleware) { described_class.new(app) } - let(:steam_env) { { 'REQUEST_METHOD' => 'GET', 'steam.site' => site, 'steam.page' => page, 'steam.live_editing' => false, 'PATH_INFO' => 'foo', 'QUERY_STRING' => 'a=1&c=3' } } + let(:steam_env) { { 'Content-Type' => 'text/html', 'REQUEST_METHOD' => 'GET', 'steam.site' => site, 'steam.page' => page, 'steam.live_editing' => false, 'PATH_INFO' => 'foo', 'QUERY_STRING' => 'a=1&c=3' } } describe '#call' do subject { middleware.call(env_for('foo', steam_env)) } @@ -27,20 +27,21 @@ it 'does not go to the next middleware' do middleware.call(env_for('foo', steam_env)) # warm up the cache expect(middleware.app).not_to receive(:call) expect(subject.first).to eq 200 + expect(subject[1]['Content-Type']).to eq 'text/html' end end end describe '#cache_key' do subject { middleware.send(:cache_key, steam_env) } - it { expect(subject).to eq '93a2150e6ee016394b95f1a6944c1f69' } + it { expect(subject).to eq '6f10bd02e43a99e1bef1223da0e266ec' } end describe '#cacheable?' do