Sha256: 95842b425a26f003887691e2040ff0ad7dbd14f778051c96705f679df6ca00fb
Contents?: true
Size: 1.04 KB
Versions: 9
Compression:
Stored size: 1.04 KB
Contents
require 'spec_helper' describe 'Enable SSL admin' do before :each do FactoryGirl.create('existing site') FactoryGirl.create(:account) host!('models.example.com') Locomotive.config.enable_admin_ssl = true end it 'should redirect to SSL on admin when enabled' do get '/locomotive/pages' expect(response.status).to eq(302) expect(response.location).to match(/https/) end context 'admin ssl disabled' do before do Locomotive.config.enable_admin_ssl = false end it 'should not redirect to SSL on admin when disabled' do get '/locomotive/pages' expect(response.status).to eq(302) expect(response.location).to match(/http/) end end context 'request for the non main domain' do before do host!('myexample.com') end it 'should not redirect to SSL' do get '/locomotive/pages' expect(response.status).to eq(302) expect(response.location).to match(/http/) end end after(:all) do Locomotive.config.enable_admin_ssl = false end end
Version data entries
9 entries across 9 versions & 1 rubygems