This commit is contained in:
Shlok Srivastava 2017-08-10 06:09:24 +00:00 committed by GitHub
commit 304339f9fc
15 changed files with 240 additions and 7 deletions

View file

@ -135,6 +135,15 @@ describe Admin::ConferencesController do
end
end
end
describe 'GET #custom_domain', blah: true do
it 'render custom domain' do
get :custom_domain, id: conference.short_title
expect(response).to render_template :custom_domain
expect(response).to be_success
end
end
end
shared_examples 'access as organization_admin' do

View file

@ -24,6 +24,20 @@ describe ConferencesController do
expect(response).to render_template :show
end
end
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
end
end
describe 'OPTIONS #index' do

View file

@ -68,6 +68,15 @@ feature Conference do
expect(conference.short_title).to eq('NewCon')
expect(Conference.count).to eq(expected_count)
end
scenario 'show custom domain of a conference', feature: true, js: true do
conference = create(:conference, custom_domain: 'mydomain.conf')
sign_in user
visit custom_domain_admin_conference_path(conference.short_title)
expect(page).to have_text('mydomain.conf')
end
end
describe 'admin' do