mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Rename 'ConferenceController' to 'ConferencesController', and 'ProposalController' to 'ProposalsController'
This commit is contained in:
parent
0b6550d060
commit
daf1f805bd
71 changed files with 225 additions and 191 deletions
38
spec/controllers/application_controller_spec.rb
Normal file
38
spec/controllers/application_controller_spec.rb
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ApplicationController, type: :controller do
|
||||
let(:conference) { create(:conference) }
|
||||
|
||||
describe 'user is signed in' do
|
||||
|
||||
describe 'as admin' do
|
||||
let(:admin) { create(:admin) }
|
||||
before { sign_in(admin) }
|
||||
|
||||
it 'redirects to the admin homepage' do
|
||||
expect(controller.after_sign_in_path_for(admin)).to eq admin_conferences_path
|
||||
end
|
||||
end
|
||||
|
||||
describe 'as regular user' do
|
||||
let(:user) { create(:user) }
|
||||
before { sign_in(user) }
|
||||
|
||||
context 'with no return_to value in the session' do
|
||||
it 'redirects to the root_path' do
|
||||
expect(controller.after_sign_in_path_for(user)).to eq root_path
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a specific return_to value provided in the session' do
|
||||
it 'redirects to the conferences_path' do
|
||||
@request.session['return_to'] = conferences_path
|
||||
expect(controller.after_sign_in_path_for(user)).to eq conferences_path
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue