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
|
2016-05-02 15:21:45 +02:00
|
|
|
let!(:conference) { create(:full_conference) }
|
|
|
|
|
|
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')
|
2016-05-02 15:21:45 +02:00
|
|
|
assign :conference, conference
|
2014-05-19 21:21:06 +05:30
|
|
|
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
|
2016-05-02 17:39:06 +02:00
|
|
|
expect(rendered).to match(CGI.escapeHTML(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')
|
2016-05-02 15:21:45 +02:00
|
|
|
expect(rendered).to match(conference.contact.email)
|
|
|
|
|
expect(rendered).to match(conference.sponsors.first.website_url)
|
2016-05-02 17:39:06 +02:00
|
|
|
expect(rendered).to match(CGI.escapeHTML(conference.sponsors.first.description))
|
2016-05-02 15:21:45 +02:00
|
|
|
expect(rendered).to match(conference.sponsors.first.logo_file_name)
|
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')
|
2016-05-02 15:21:45 +02:00
|
|
|
expect(rendered).to match(conference.contact.facebook)
|
|
|
|
|
expect(rendered).to match(conference.contact.googleplus)
|
|
|
|
|
expect(rendered).to match(conference.contact.instagram)
|
|
|
|
|
expect(rendered).to match(conference.contact.twitter)
|
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')
|
2016-05-02 17:39:06 +02:00
|
|
|
expect(rendered).to match(CGI.escapeHTML(conference.venue.name))
|
2016-05-02 15:21:45 +02:00
|
|
|
expect(rendered).to match(conference.venue.street)
|
|
|
|
|
expect(rendered).to match(conference.venue.website)
|
2016-05-02 17:39:06 +02:00
|
|
|
expect(rendered).to match(CGI.escapeHTML(conference.venue.description))
|
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')
|
2016-05-02 17:39:06 +02:00
|
|
|
expect(rendered).to match(CGI.escapeHTML(conference.lodgings.first.name))
|
|
|
|
|
expect(rendered).to match(CGI.escapeHTML(conference.lodgings.first.description))
|
2016-05-02 15:21:45 +02:00
|
|
|
# FIXME: Lodging without image doesn't show link
|
|
|
|
|
# expect(rendered).to match(conference.lodgings.first.website_link)
|
2014-06-14 23:37:12 +05:30
|
|
|
end
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|