mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-16 13:14:03 +00:00
Refactor /calendars into it's own controller
Spec it out too
This commit is contained in:
parent
6e276b2787
commit
f23d1f04b5
7 changed files with 128 additions and 74 deletions
32
spec/controllers/calendars_controller_spec.rb
Normal file
32
spec/controllers/calendars_controller_spec.rb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe CalendarsController do
|
||||
render_views
|
||||
|
||||
let!(:conference) { create(:conference, splashpage: create(:splashpage, public: true), venue: create(:venue)) }
|
||||
let!(:events) { create_list(:event_scheduled, 2, program: conference.program) }
|
||||
|
||||
describe 'GET #index' do
|
||||
before :each do
|
||||
conference.program.update(schedule_public: true)
|
||||
get :index, format: :ics
|
||||
end
|
||||
|
||||
it 'renders a calendar from conference' do
|
||||
expect(response.body).to match(/#{conference.title}/im)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET #index with full format' do
|
||||
before :each do
|
||||
conference.program.update(schedule_public: true)
|
||||
get :index, format: :ics, params: { full: 1 }
|
||||
end
|
||||
|
||||
it 'renders a calendar from events' do
|
||||
expect(response.body).to match(/#{events.first.title}/im)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue