use :full_conference factory in the conference view specs
This commit is contained in:
parent
dd5796bd34
commit
1c7becb69a
5 changed files with 38 additions and 63 deletions
|
|
@ -12,24 +12,24 @@
|
||||||
.row
|
.row
|
||||||
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
|
.col-md-6.col-md-offset-3.col-sm-10.col-sm-offset-1
|
||||||
%p
|
%p
|
||||||
- if @program.event_types.any?
|
- if @conference.program.event_types.any?
|
||||||
You can submit proposals for
|
You can submit proposals for
|
||||||
%span.notranslate
|
%span.notranslate
|
||||||
= "#{event_types(@conference)}."
|
= "#{event_types(@conference)}."
|
||||||
- if @program.tracks.any?
|
- if @conference.program.tracks.any?
|
||||||
Proposals should fit in one of the
|
Proposals should fit in one of the
|
||||||
%span.notranslate
|
%span.notranslate
|
||||||
= "#{pluralize(@program.tracks.count, 'track')}:"
|
= "#{pluralize(@conference.program.tracks.count, 'track')}:"
|
||||||
= "#{tracks(@conference)}."
|
= "#{tracks(@conference)}."
|
||||||
The submission period has begun
|
The submission period has begun
|
||||||
%em.notranslate
|
%em.notranslate
|
||||||
= @program.cfp.start_date.strftime('%A, %B %-d. %Y')
|
= @conference.program.cfp.start_date.strftime('%A, %B %-d. %Y')
|
||||||
and closes
|
and closes
|
||||||
%em.notranslate
|
%em.notranslate
|
||||||
= @program.cfp.end_date.strftime('%A, %B %-d. %Y.')
|
= @conference.program.cfp.end_date.strftime('%A, %B %-d. %Y.')
|
||||||
- if @program.cfp_open?
|
- if @conference.program.cfp_open?
|
||||||
That means you have only
|
That means you have only
|
||||||
%b.notranslate= pluralize(@program.cfp.remaining_days, 'day')
|
%b.notranslate= pluralize(@conference.program.cfp.remaining_days, 'day')
|
||||||
left!
|
left!
|
||||||
Remember
|
Remember
|
||||||
%span.notranslate
|
%span.notranslate
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
%section#program
|
%section#program
|
||||||
= render 'schedule_splashpage'
|
= render 'schedule_splashpage'
|
||||||
|
|
||||||
- if @program.cfp_open? and @conference.splashpage.include_cfp
|
- if @conference.program.cfp_open? and @conference.splashpage.include_cfp
|
||||||
%section#callforpapers
|
%section#callforpapers
|
||||||
= render 'call_for_paper'
|
= render 'call_for_paper'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'admin/conference/index' do
|
describe 'admin/conference/index' do
|
||||||
|
let(:conference) { create(:conference, title: 'openSUSE Conference 2016') }
|
||||||
|
let(:second_conference) { create(:conference) }
|
||||||
|
|
||||||
it 'renders all conference names with links' do
|
it 'renders all conference names with links' do
|
||||||
assign(:conferences, [create(:conference, title: 'openSUSE'), create(:conference)])
|
assign(:conferences, [conference, second_conference])
|
||||||
render
|
render
|
||||||
expect(rendered).to include('openSUSE')
|
expect(rendered).to include('openSUSE Conference 2016')
|
||||||
expect(rendered).to include('The dog and pony show')
|
expect(rendered).to include(second_conference.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'admin/conference/new' do
|
describe 'admin/conference/new' do
|
||||||
|
let(:conference) { build(:conference) }
|
||||||
|
|
||||||
it 'renders the new template for the conference' do
|
it 'renders the new template for the conference' do
|
||||||
assign(:conference, Conference.new)
|
assign(:conference, Conference.new)
|
||||||
render
|
render
|
||||||
expect(rendered).to include('Basic Information')
|
expect(rendered).to include('Basic Information')
|
||||||
assign(:conference, build(:conference))
|
assign(:conference, conference)
|
||||||
render
|
render
|
||||||
expect(rendered).to include('The dog and pony show')
|
expect(rendered).to include(conference.title)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,15 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
describe 'conference/show.html.haml' do
|
describe 'conference/show.html.haml' do
|
||||||
|
let!(:conference) { create(:full_conference) }
|
||||||
|
|
||||||
before(:each) do
|
before(:each) do
|
||||||
allow(view).to receive(:date_string).and_return('January 17 - 21 2014')
|
allow(view).to receive(:date_string).and_return('January 17 - 21 2014')
|
||||||
@conference = create(:conference, description: 'Lorem Ipsum')
|
assign :conference, conference
|
||||||
@program = @conference.program
|
|
||||||
|
|
||||||
@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,
|
|
||||||
include_lodgings: true,
|
|
||||||
include_cfp: true)
|
|
||||||
|
|
||||||
@conference.contact.update(sponsor_email: 'example@example.com',
|
|
||||||
facebook: 'http://facebook.com',
|
|
||||||
googleplus: 'http://google.com',
|
|
||||||
instagram: 'http://instagram.com',
|
|
||||||
twitter: 'http://twitter.com')
|
|
||||||
|
|
||||||
@conference.registration_period = create(:registration_period,
|
|
||||||
start_date: Date.yesterday,
|
|
||||||
end_date: Date.tomorrow)
|
|
||||||
|
|
||||||
@conference.program.cfp = create(:cfp, program: @conference.program)
|
|
||||||
|
|
||||||
@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)
|
|
||||||
|
|
||||||
@conference.venue = create(:venue)
|
|
||||||
@conference.lodgings << create(:lodging)
|
|
||||||
assign :conference, @conference
|
|
||||||
render
|
render
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders banner component' do
|
it 'renders banner component' do
|
||||||
expect(rendered).to match(/#{@conference.description}/)
|
expect(rendered).to match(conference.description)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders program partial' do
|
it 'renders program partial' do
|
||||||
|
|
@ -57,32 +26,33 @@ describe 'conference/show.html.haml' do
|
||||||
|
|
||||||
it 'renders sponsors partial' do
|
it 'renders sponsors partial' do
|
||||||
expect(view).to render_template(partial: 'conference/_sponsors')
|
expect(view).to render_template(partial: 'conference/_sponsors')
|
||||||
expect(rendered).to match(/example@example.com/)
|
expect(rendered).to match(conference.contact.email)
|
||||||
expect(rendered).to match(/www.example.com/)
|
expect(rendered).to match(conference.sponsors.first.website_url)
|
||||||
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
expect(rendered).to match(conference.sponsors.first.description)
|
||||||
expect(rendered).to match(/rails.png/)
|
expect(rendered).to match(conference.sponsors.first.logo_file_name)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders social media partial' do
|
it 'renders social media partial' do
|
||||||
expect(view).to render_template('conference/_social_media')
|
expect(view).to render_template('conference/_social_media')
|
||||||
expect(rendered).to match(/facebook.com/)
|
expect(rendered).to match(conference.contact.facebook)
|
||||||
expect(rendered).to match(/google.com/)
|
expect(rendered).to match(conference.contact.googleplus)
|
||||||
expect(rendered).to match(/instagram.com/)
|
expect(rendered).to match(conference.contact.instagram)
|
||||||
expect(rendered).to match(/twitter.com/)
|
expect(rendered).to match(conference.contact.twitter)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders venue partial' do
|
it 'renders venue partial' do
|
||||||
expect(view).to render_template(partial: 'conference/_venue')
|
expect(view).to render_template(partial: 'conference/_venue')
|
||||||
expect(rendered).to match(/Suse Office/)
|
expect(rendered).to match(conference.venue.name)
|
||||||
expect(rendered).to match(/Maxfeldstrasse 5/)
|
expect(rendered).to match(conference.venue.street)
|
||||||
expect(rendered).to match(/www.opensuse.org/)
|
expect(rendered).to match(conference.venue.website)
|
||||||
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
expect(rendered).to match(conference.venue.description)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'renders lodging partial' do
|
it 'renders lodging partial' do
|
||||||
expect(view).to render_template(partial: 'conference/_lodging')
|
expect(view).to render_template(partial: 'conference/_lodging')
|
||||||
expect(rendered).to match(/Example Hotel/)
|
expect(rendered).to match(conference.lodgings.first.name)
|
||||||
expect(rendered).to match(/Lorem Ipsum Dolor/)
|
expect(rendered).to match(conference.lodgings.first.description)
|
||||||
expect(rendered).to match(/www.example.com/)
|
# FIXME: Lodging without image doesn't show link
|
||||||
|
# expect(rendered).to match(conference.lodgings.first.website_link)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue