Add controller tests for admin::versions#index
This commit is contained in:
parent
614da6003b
commit
71c8dd4127
1 changed files with 15 additions and 0 deletions
|
|
@ -97,5 +97,20 @@ describe Admin::VersionsController do
|
||||||
expect(flash[:error]).to match('Revert failed. Attribute missing or invalid')
|
expect(flash[:error]).to match('Revert failed. Attribute missing or invalid')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'GET #index' do
|
||||||
|
it 'raises error if conference_id is invalid' do
|
||||||
|
sign_in admin
|
||||||
|
get :index, conference_id: 88
|
||||||
|
expect(flash[:error]).to match('Conference with ID 88 does not exist!')
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'raises error if user is not an organizer of specified conference' do
|
||||||
|
user = create(:user)
|
||||||
|
sign_in user
|
||||||
|
get :index, conference_id: conference.id
|
||||||
|
expect(flash[:alert]).to match('You are not authorized to access this area.')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue