appearance_controller_spec.rb 735 B

1234567891011121314151617181920212223242526272829303132333435
  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' do
  14. expect(response).to have_http_status(200)
  15. end
  16. it 'returns private cache control headers' do
  17. expect(response.headers['Cache-Control']).to include('private, no-store')
  18. end
  19. end
  20. describe 'PUT #update' do
  21. it 'redirects correctly' do
  22. put :update, params: { user: { setting_theme: 'contrast' } }
  23. expect(response).to redirect_to(settings_preferences_appearance_path)
  24. end
  25. end
  26. end