appearance_controller_spec.rb 732 B

1234567891011121314151617181920212223242526272829303132
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe Settings::Preferences::AppearanceController do
  4. render_views
  5. let!(:user) { Fabricate(:user) }
  6. before do
  7. sign_in user, scope: :user
  8. end
  9. describe 'GET #show' do
  10. before do
  11. get :show
  12. end
  13. it 'returns http success with private cache control headers', :aggregate_failures do
  14. expect(response).to have_http_status(200)
  15. expect(response.headers['Cache-Control']).to include('private, no-store')
  16. end
  17. end
  18. describe 'PUT #update' do
  19. it 'redirects correctly' do
  20. put :update, params: { user: { setting_theme: 'contrast' } }
  21. expect(response).to redirect_to(settings_preferences_appearance_path)
  22. end
  23. end
  24. end