Extracted Splashpage from Conference

#418
This commit is contained in:
Chrisbr 2014-08-30 12:08:24 +02:00
parent 7793497862
commit fedb0753bf
42 changed files with 578 additions and 236 deletions

View file

@ -1,7 +1,7 @@
require 'spec_helper'
describe ConferenceController do
let(:conference) { create(:conference, make_conference_public: true) }
let(:conference) { create(:conference, splashpage: create(:splashpage, public: true)) }
describe 'GET #show' do
context 'conference made public' do
@ -15,19 +15,7 @@ describe ConferenceController do
expect(response).to render_template :show
end
end
context 'conference is not public' do
before(:each) { conference.update_attribute(:make_conference_public, false) }
it 'redirects to root path' do
get :show, id: conference.short_title
expect(response).to redirect_to root_path
end
it 'renders flash saying conference not ready' do
get :show, id: conference.short_title
expect(flash[:alert]).to eq('You are not authorized to access this page.')
end
end
context 'gallery photos for splash' do
it 'return conference photos' do
xhr :get, :gallery_photos, id: conference.short_title