2014-05-19 21:21:06 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
2016-09-14 22:42:04 -04:00
|
|
|
describe ConferencesController do
|
|
|
|
|
let(:conference) { create(:conference, splashpage: create(:splashpage, public: true), venue: create(:venue)) }
|
2016-06-20 21:05:08 +03:00
|
|
|
let!(:cfp) { create(:cfp, program: conference.program) }
|
|
|
|
|
let(:room) { create(:room, venue: conference.venue) }
|
2014-08-12 11:51:59 +03:00
|
|
|
|
2014-11-14 17:24:24 +01:00
|
|
|
describe 'GET #index' do
|
|
|
|
|
it 'Response code is 200' do
|
|
|
|
|
get :index
|
|
|
|
|
expect(response.response_code).to eq(200)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-05-19 21:25:42 +05:30
|
|
|
describe 'GET #show' do
|
2014-06-17 00:47:49 +05:30
|
|
|
context 'conference made public' do
|
|
|
|
|
it 'assigns the requested conference to conference' do
|
|
|
|
|
get :show, id: conference.short_title
|
|
|
|
|
expect(assigns(:conference)).to eq conference
|
|
|
|
|
end
|
2014-05-19 21:21:06 +05:30
|
|
|
|
2014-06-17 00:47:49 +05:30
|
|
|
it 'renders the show template' do
|
|
|
|
|
get :show, id: conference.short_title
|
|
|
|
|
expect(response).to render_template :show
|
|
|
|
|
end
|
2017-08-02 20:16:50 +05:30
|
|
|
end
|
2017-07-26 09:04:07 +05:30
|
|
|
|
2017-08-02 20:16:50 +05:30
|
|
|
context 'accessing conference via custom domain' do
|
|
|
|
|
before do
|
2017-07-26 09:04:07 +05:30
|
|
|
conference.update_attribute(:custom_domain, 'lvh.me')
|
|
|
|
|
@request.host = 'lvh.me'
|
2017-08-02 20:16:50 +05:30
|
|
|
end
|
2017-07-26 09:04:07 +05:30
|
|
|
|
2017-08-02 20:16:50 +05:30
|
|
|
it 'assigns correct conference' do
|
2017-07-26 09:04:07 +05:30
|
|
|
get :show
|
2017-08-02 20:16:50 +05:30
|
|
|
|
2017-07-26 09:04:07 +05:30
|
|
|
expect(response).to render_template :show
|
|
|
|
|
expect(assigns(:conference)).to eq conference
|
|
|
|
|
end
|
2014-06-17 00:47:49 +05:30
|
|
|
end
|
2014-05-28 15:06:08 +05:30
|
|
|
end
|
2014-11-14 17:24:24 +01:00
|
|
|
|
|
|
|
|
describe 'OPTIONS #index' do
|
|
|
|
|
it 'Response code is 200' do
|
|
|
|
|
process :index, 'OPTIONS'
|
|
|
|
|
expect(response.response_code).to eq(200)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|