Allow root URL to redirect to a conference via ENV var.

This commit is contained in:
James Mason 2018-03-03 21:36:20 -08:00
parent 137d997793
commit fc146a1371
No known key found for this signature in database
GPG key ID: 1B3951886C449023
5 changed files with 41 additions and 2 deletions

View file

@ -0,0 +1,28 @@
require 'spec_helper'
feature 'Routing', type: :routing do
let(:conference) { create(:conference) }
context 'the root URL' do
it 'routes to conferences#index' do
expect(get: '/').to route_to(
controller: 'conferences',
action: 'index'
)
end
# FIXME: this doesn't work due to routes being statically loaded
# See https://github.com/rspec/rspec-rails/issues/817 for example
# context 'with OSEM_ROOT_CONFERENCE set' do
# it 'redirects to the conference' do
# ClimateControl.modify OSEM_ROOT_CONFERENCE: conference.short_title do
# expect(get: '/').to route_to(
# controller: 'conferences',
# action: 'show',
# id: conference.short_title
# )
# end
# end
# end
end
end