mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Adds routing error check in conference#show
Adds make_conference_public to conference factory Added test
This commit is contained in:
parent
291a61bc8d
commit
2b94ba0281
4 changed files with 23 additions and 7 deletions
|
|
@ -3,14 +3,24 @@ require 'spec_helper'
|
|||
describe ConferenceController do
|
||||
let(:conference) { create(:conference) }
|
||||
describe 'GET #show' do
|
||||
it 'assigns the requested conference to conference' do
|
||||
get :show, id: conference.short_title
|
||||
expect(assigns(:conference)).to eq conference
|
||||
end
|
||||
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
|
||||
|
||||
it 'renders the show template' do
|
||||
get :show, id: conference.short_title
|
||||
expect(response).to render_template :show
|
||||
it 'renders the show template' do
|
||||
get :show, id: conference.short_title
|
||||
expect(response).to render_template :show
|
||||
end
|
||||
end
|
||||
context 'conference is not public' do
|
||||
it 'raises routing error' do
|
||||
# rendered as 404 NOT FOUND in production environment
|
||||
conference.update_attribute(:make_conference_public, false)
|
||||
expect { get :show, id: conference.short_title }.
|
||||
to raise_error(ActionController::RoutingError)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue