This repository has been archived on 2024-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
2023-03-10 07:33:30 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
describe FiltersController do
|
|
|
|
render_views
|
|
|
|
|
|
|
|
describe 'GET #index' do
|
|
|
|
context 'with signed out user' do
|
2023-04-19 10:07:29 -04:00
|
|
|
before do
|
2023-03-10 07:33:30 -05:00
|
|
|
get :index
|
2023-04-19 10:07:29 -04:00
|
|
|
end
|
2023-03-10 07:33:30 -05:00
|
|
|
|
2023-04-19 10:07:29 -04:00
|
|
|
it 'redirects' do
|
2023-03-10 07:33:30 -05:00
|
|
|
expect(response).to be_redirect
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with a signed in user' do
|
2023-04-19 10:07:29 -04:00
|
|
|
before do
|
|
|
|
sign_in(Fabricate(:user))
|
2023-03-10 07:33:30 -05:00
|
|
|
get :index
|
2023-04-19 10:07:29 -04:00
|
|
|
end
|
2023-03-10 07:33:30 -05:00
|
|
|
|
2023-04-19 10:07:29 -04:00
|
|
|
it 'returns http success' do
|
2023-03-10 07:33:30 -05:00
|
|
|
expect(response).to have_http_status(200)
|
|
|
|
end
|
2023-04-19 10:07:29 -04:00
|
|
|
|
|
|
|
it 'returns private cache control headers' do
|
|
|
|
expect(response.headers['Cache-Control']).to include('private, no-store')
|
|
|
|
end
|
2023-03-10 07:33:30 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|