If there are only one conference in the future and it has a public splashpage, redirect to it in conferences#index.
Change tests root_path to conference_path(conference). fix #1259
This commit is contained in:
parent
0cb273749a
commit
73fdcaf4c9
7 changed files with 174 additions and 140 deletions
|
|
@ -6,9 +6,39 @@ describe ConferencesController do
|
|||
let(:room) { create(:room, venue: conference.venue) }
|
||||
|
||||
describe 'GET #index' do
|
||||
it 'Response code is 200' do
|
||||
get :index
|
||||
expect(response.response_code).to eq(200)
|
||||
context 'without conference' do
|
||||
it 'Response code is 200' do
|
||||
conference.destroy!
|
||||
get :index
|
||||
expect(response.response_code).to eq(200)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with one next conference' do
|
||||
describe 'with splashpage' do
|
||||
it 'Response code is 200 when is not public' do
|
||||
current = Conference.first
|
||||
current.splashpage.public = false
|
||||
current.splashpage.save
|
||||
get :index
|
||||
expect(response.response_code).to eq(200)
|
||||
end
|
||||
it 'Response code is 302 when is public' do
|
||||
get :index
|
||||
expect(response.response_code).to eq(302)
|
||||
end
|
||||
it 'Redirect to conference#show' do
|
||||
get :index
|
||||
expect(response).to redirect_to(conference_path(conference))
|
||||
end
|
||||
end
|
||||
describe 'without splashpage' do
|
||||
it 'Response code is 200' do
|
||||
conference.splashpage.destroy!
|
||||
get :index
|
||||
expect(response.response_code).to eq(200)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue