Sha256: 8b7ecb39d611c1454b074e3e4cc172019a7386f5634c0b17f5fc170db598eef6
Contents?: true
Size: 1.32 KB
Versions: 2
Compression:
Stored size: 1.32 KB
Contents
require 'spec_helper' describe Qbrick::Cms::SettingsController, type: :controller do render_views routes { Qbrick::Engine.routes } before do admin = double 'admin' allow_message_expectations_on_nil allow(request.env['warden']).to receive(:authenticate!) { admin } allow(controller).to receive(:current_admin) { admin } end describe 'GET index' do it 'renders saved settings' do Qbrick::Settings.highlighting_font = 'Comic Sans' get :index expect(response).to be_success expect(response.body).to include(I18n.t 'settings.attributes.highlighting_font.name') end it 'renders default settings' do Qbrick::Settings.defaults[:highlighting_font] = 'Comic Sans' get :index expect(response).to be_success expect(response.body).to include(I18n.t 'settings.attributes.highlighting_font.name') end end describe 'POST update_all' do it 'updates settings' do Qbrick::Settings.defaults[:highlighting_font] = 'Comic Sans' post :update_all, settings: { 'highlighting_font' => 'Comic Sans Neue' } expect(response).to redirect_to("#{Qbrick::Engine.routes.url_helpers.cms_settings_path}?content_locale=#{I18n.locale}") setting = Qbrick::Settings.find_by var: 'highlighting_font' expect(setting.value).to eq 'Comic Sans Neue' end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
qbrick-2.7.1 | spec/controllers/qbrick/cms/settings_controller_spec.rb |
qbrick-2.7 | spec/controllers/qbrick/cms/settings_controller_spec.rb |