refactored DomainConstraint and conference_controller_spec

use params id instead of OSEM_HOSTNAME to load conference
This commit is contained in:
shlok007 2017-08-02 20:16:50 +05:30 committed by Shlok Srivastava
parent 66b48be968
commit 835859e350
3 changed files with 18 additions and 9 deletions

View file

@ -23,12 +23,17 @@ describe ConferencesController do
get :show, id: conference.short_title
expect(response).to render_template :show
end
end
it 'assigns correct conference from a custom domain' do
context 'accessing conference via custom domain' do
before do
conference.update_attribute(:custom_domain, 'lvh.me')
@request.host = 'lvh.me'
end
it 'assigns correct conference' do
get :show
expect(response).to render_template :show
expect(assigns(:conference)).to eq conference
end