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-07-10 21:29:07 +05:30
|
|
|
allow(view).to receive(:date_string).and_return("January 17 - 21 2014")
|
2014-05-30 00:54:45 +05:30
|
|
|
@conference = create(:conference, registration_description: 'Lorem Ipsum Dolor',
|
|
|
|
|
registration_start_date: Date.today,
|
|
|
|
|
registration_end_date: Date.tomorrow,
|
2014-06-13 00:49:48 +05:30
|
|
|
description: 'Lorem Ipsum',
|
|
|
|
|
sponsor_description: 'Lorem Ipsum Dolor',
|
2014-06-13 02:02:27 +05:30
|
|
|
sponsor_email: 'example@example.com',
|
2014-06-18 22:25:42 +05:30
|
|
|
include_registrations_in_splash: true,
|
|
|
|
|
include_program_in_splash: true,
|
|
|
|
|
include_sponsors_in_splash: true,
|
|
|
|
|
include_tracks_in_splash: true,
|
2014-06-20 20:16:22 +05:30
|
|
|
include_tickets_in_splash: true,
|
|
|
|
|
include_banner_in_splash: true)
|
2014-07-31 20:09:38 +02:00
|
|
|
@conference.contact.update(facebook: 'http://www.fbexample.com',
|
|
|
|
|
googleplus: 'http://www.google-example.com',
|
|
|
|
|
instagram: 'http://instagram.com',
|
|
|
|
|
twitter: 'http://twitter.com',
|
|
|
|
|
public: true
|
|
|
|
|
)
|
|
|
|
|
@conference.call_for_papers = create(:call_for_papers, conference: @conference,
|
|
|
|
|
include_cfp_in_splash: true)
|
2014-06-18 22:25:42 +05:30
|
|
|
@conference.call_for_papers = create(:call_for_papers, conference: @conference,
|
|
|
|
|
include_cfp_in_splash: true)
|
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-06-18 22:25:42 +05:30
|
|
|
@conference.venue = create(:venue, include_venue_in_splash: true,
|
|
|
|
|
include_lodgings_in_splash: true)
|
2014-06-14 23:37:12 +05:30
|
|
|
@conference.venue.lodgings << create(:lodging, venue: @conference.venue)
|
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-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include("#{@conference.description}")
|
2014-06-26 22:25:15 +05:30
|
|
|
expect(view.content_for(:splash)).to include("#{@conference.short_title}")
|
2014-06-20 20:16:22 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'renders program partial' do
|
2014-05-28 14:49:00 +05:30
|
|
|
expect(view).to render_template(partial: 'conference/_program')
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|
2014-05-28 18:12:45 +05:30
|
|
|
|
|
|
|
|
it 'renders registration partial' do
|
2014-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include("#{@conference.registration_description}")
|
2014-05-28 18:12:45 +05:30
|
|
|
expect(view).to render_template(partial: 'conference/_registration')
|
|
|
|
|
end
|
2014-05-22 16:32:50 +05:30
|
|
|
|
|
|
|
|
it 'renders call_for_papers partial' do
|
2014-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include("#{@conference.call_for_papers.description}")
|
2014-05-22 16:32:50 +05:30
|
|
|
end
|
2014-06-13 00:49:48 +05:30
|
|
|
|
|
|
|
|
it 'renders sponsors partial' do
|
|
|
|
|
expect(view).to render_template(partial: 'conference/_sponsor')
|
2014-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
|
|
|
|
|
expect(view.content_for(:splash)).to include('example@example.com')
|
|
|
|
|
expect(view.content_for(:splash)).to include('Platin')
|
|
|
|
|
expect(view.content_for(:splash)).to include('Example sponsor')
|
|
|
|
|
expect(view.content_for(:splash)).to include('http://www.example.com')
|
|
|
|
|
expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
|
|
|
|
|
expect(view.content_for(:splash)).to include('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-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include('http://www.fbexample.com')
|
|
|
|
|
expect(view.content_for(:splash)).to include('http://www.google-example.com')
|
2014-08-12 11:51:59 +03:00
|
|
|
expect(view.content_for(:splash)).to include('http://instagram.com')
|
|
|
|
|
expect(view.content_for(:splash)).to include('http://twitter.com')
|
2014-06-13 00:49:48 +05:30
|
|
|
end
|
2014-06-14 18:49:10 +05:30
|
|
|
|
|
|
|
|
it 'renders location partial' do
|
|
|
|
|
expect(view).to render_template(partial: 'conference/_location')
|
2014-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include('Suse Office')
|
|
|
|
|
expect(view.content_for(:splash)).to include('Maxfeldstrasse 5 \n90409 Nuremberg')
|
|
|
|
|
expect(view.content_for(:splash)).to include('www.opensuse.org')
|
|
|
|
|
expect(view.content_for(:splash)).to include('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-06-20 18:28:42 +05:30
|
|
|
expect(view.content_for(:splash)).to include('Example Hotel')
|
|
|
|
|
expect(view.content_for(:splash)).to include('Lorem Ipsum Dolor')
|
|
|
|
|
expect(view.content_for(:splash)).to include('http://www.example.com')
|
2014-06-14 23:37:12 +05:30
|
|
|
end
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|