2014-05-19 21:21:06 +05:30
|
|
|
require 'spec_helper'
|
2014-05-19 21:25:42 +05:30
|
|
|
describe 'conference/show.html.haml' do
|
2014-05-30 00:54:45 +05:30
|
|
|
before(:each) do
|
2014-08-19 20:14:27 +03:00
|
|
|
allow(view).to receive(:date_string).and_return('January 17 - 21 2014')
|
2014-11-18 00:58:43 +01:00
|
|
|
@conference = create(:conference, description: 'Lorem Ipsum')
|
2014-08-30 12:08:24 +02:00
|
|
|
|
|
|
|
|
@conference.splashpage = create(:splashpage,
|
|
|
|
|
include_registrations: true,
|
|
|
|
|
include_program: true,
|
|
|
|
|
include_sponsors: true,
|
|
|
|
|
include_tracks: true,
|
|
|
|
|
include_tickets: true,
|
|
|
|
|
include_social_media: true,
|
|
|
|
|
include_venue: true,
|
2014-12-08 18:08:21 +02:00
|
|
|
include_lodgings: true,
|
|
|
|
|
include_cfp: true)
|
2014-09-30 11:59:02 +02:00
|
|
|
|
|
|
|
|
@conference.contact.update(sponsor_email: 'example@example.com',
|
2014-11-14 11:58:36 +01:00
|
|
|
facebook: 'http://facebook.com',
|
|
|
|
|
googleplus: 'http://google.com',
|
2014-07-31 20:09:38 +02:00
|
|
|
instagram: 'http://instagram.com',
|
2014-08-30 12:08:24 +02:00
|
|
|
twitter: 'http://twitter.com')
|
2014-09-30 11:59:02 +02:00
|
|
|
|
2014-08-18 14:33:02 +02:00
|
|
|
@conference.registration_period = create(:registration_period,
|
2014-11-14 11:58:36 +01:00
|
|
|
start_date: Date.yesterday,
|
2014-08-18 14:33:02 +02:00
|
|
|
end_date: Date.tomorrow)
|
2014-09-30 11:59:02 +02:00
|
|
|
|
2014-12-08 18:08:21 +02:00
|
|
|
@conference.call_for_paper = create(:call_for_paper, conference: @conference)
|
2014-09-30 11:59:02 +02:00
|
|
|
|
2014-06-13 00:49:48 +05:30
|
|
|
@conference.sponsorship_levels << create(:sponsorship_level, conference: @conference)
|
|
|
|
|
@sponsorship_level = @conference.sponsorship_levels.first
|
|
|
|
|
@sponsorship_level.sponsors << create(:sponsor, sponsorship_level: @sponsorship_level,
|
|
|
|
|
conference: @conference)
|
2014-09-30 11:59:02 +02:00
|
|
|
|
2014-08-30 12:08:24 +02:00
|
|
|
@conference.venue = create(:venue)
|
2014-11-20 14:57:03 +01:00
|
|
|
@conference.lodgings << create(:lodging)
|
2014-05-19 21:21:06 +05:30
|
|
|
assign :conference, @conference
|
|
|
|
|
render
|
2014-05-30 00:54:45 +05:30
|
|
|
end
|
2014-05-22 16:32:50 +05:30
|
|
|
|
2014-06-20 20:16:22 +05:30
|
|
|
it 'renders banner component' do
|
2014-11-18 00:58:43 +01:00
|
|
|
expect(rendered).to match(/#{@conference.description}/)
|
2014-06-20 20:16:22 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'renders program partial' do
|
2015-03-09 15:31:06 +01:00
|
|
|
expect(view).to render_template(partial: 'conference/_schedule_splashpage')
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|
2014-05-28 18:12:45 +05:30
|
|
|
|
|
|
|
|
it 'renders registration partial' do
|
|
|
|
|
expect(view).to render_template(partial: 'conference/_registration')
|
|
|
|
|
end
|
2014-05-22 16:32:50 +05:30
|
|
|
|
2014-11-25 10:47:18 +01:00
|
|
|
it 'renders call_for_paper partial' do
|
2014-11-20 14:57:03 +01:00
|
|
|
expect(rendered).to match(/We are ready to accept your proposals for sessions!/)
|
2014-05-22 16:32:50 +05:30
|
|
|
end
|
2014-06-13 00:49:48 +05:30
|
|
|
|
|
|
|
|
it 'renders sponsors partial' do
|
2014-11-14 11:58:36 +01:00
|
|
|
expect(view).to render_template(partial: 'conference/_sponsors')
|
|
|
|
|
expect(rendered).to match(/example@example.com/)
|
|
|
|
|
expect(rendered).to match(/Example sponsor/)
|
|
|
|
|
expect(rendered).to match(/www.example.com/)
|
|
|
|
|
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
|
|
|
|
expect(rendered).to match(/rails.jpg/)
|
2014-06-13 02:43:58 +05:30
|
|
|
end
|
2014-06-13 02:02:27 +05:30
|
|
|
|
|
|
|
|
it 'renders social media partial' do
|
|
|
|
|
expect(view).to render_template('conference/_social_media')
|
2014-11-14 11:58:36 +01:00
|
|
|
expect(rendered).to match(/facebook.com/)
|
|
|
|
|
expect(rendered).to match(/google.com/)
|
|
|
|
|
expect(rendered).to match(/instagram.com/)
|
|
|
|
|
expect(rendered).to match(/twitter.com/)
|
2014-06-13 00:49:48 +05:30
|
|
|
end
|
2014-06-14 18:49:10 +05:30
|
|
|
|
2014-11-20 14:57:03 +01:00
|
|
|
it 'renders venue partial' do
|
|
|
|
|
expect(view).to render_template(partial: 'conference/_venue')
|
2014-11-14 11:58:36 +01:00
|
|
|
expect(rendered).to match(/Suse Office/)
|
|
|
|
|
expect(rendered).to match(/Maxfeldstrasse 5/)
|
|
|
|
|
expect(rendered).to match(/www.opensuse.org/)
|
|
|
|
|
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
2014-06-14 18:49:10 +05:30
|
|
|
end
|
2014-06-14 23:37:12 +05:30
|
|
|
|
|
|
|
|
it 'renders lodging partial' do
|
|
|
|
|
expect(view).to render_template(partial: 'conference/_lodging')
|
2014-11-14 11:58:36 +01:00
|
|
|
expect(rendered).to match(/Example Hotel/)
|
|
|
|
|
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
|
|
|
|
expect(rendered).to match(/www.example.com/)
|
2014-06-14 23:37:12 +05:30
|
|
|
end
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|