mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
When viewing a conference, the Instance Name in the header points to /organizations. On the organizations index, there's a button to see conferences, but it does nothing. This makes it easy for public users to get lost. This commit: * Adds a function to the organizations controller to show child conferences * Adds a public permission to see conferences through an organization * Represents a subset of conferences, reusing conferences/index view, for the organization
58 lines
1.4 KiB
Ruby
58 lines
1.4 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe OrganizationsController do
|
|
let!(:organization) { create(:organization) }
|
|
let!(:conference) do
|
|
create(
|
|
:conference,
|
|
splashpage: create(:splashpage, public: true),
|
|
venue: create(:venue),
|
|
organization: organization
|
|
)
|
|
end
|
|
let!(:antiquated_conference) do
|
|
create(
|
|
:conference,
|
|
splashpage: create(:splashpage, public: true),
|
|
venue: create(:venue),
|
|
organization: organization,
|
|
start_date: 2.weeks.ago,
|
|
end_date: 1.week.ago
|
|
)
|
|
end
|
|
|
|
let!(:other_conference) { create(:conference) }
|
|
let!(:user) { create(:user) }
|
|
|
|
describe 'GET #index' do
|
|
before :each do
|
|
sign_in user
|
|
get :index
|
|
end
|
|
|
|
it { expect(response).to render_template('index') }
|
|
end
|
|
|
|
describe 'GET #conferences' do
|
|
before :each do
|
|
get :conferences, id: organization.id
|
|
end
|
|
|
|
it 'loads the organization' do
|
|
expect(assigns(:organization)).to eq organization
|
|
end
|
|
|
|
it 'includes organization conferences' do
|
|
expect(assigns(:current)).to include conference
|
|
end
|
|
|
|
it 'does not include conferences outside organization' do
|
|
expect(assigns(:current)).not_to include other_conference
|
|
expect(assigns(:antiquated)).not_to include other_conference
|
|
end
|
|
|
|
it 'includes antiquated organization conferences' do
|
|
expect(assigns(:antiquated)).to include antiquated_conference
|
|
end
|
|
end
|
|
end
|