Changed splash layout

Changed view spec to render with content_for
This commit is contained in:
Gopesh Tulsyan 2014-06-20 18:28:42 +05:30
parent 8ebf9de76c
commit 23ad35caea
3 changed files with 57 additions and 53 deletions

View file

@ -31,49 +31,49 @@ describe 'conference/show.html.haml' do
end
it 'renders program partial' do
expect(render).to include("#{@conference.description}")
expect(view.content_for(:splash)).to include("#{@conference.description}")
expect(view).to render_template(partial: 'conference/_program')
end
it 'renders registration partial' do
expect(rendered).to include("#{@conference.registration_description}")
expect(view.content_for(:splash)).to include("#{@conference.registration_description}")
expect(view).to render_template(partial: 'conference/_registration')
end
it 'renders call_for_papers partial' do
expect(render).to include("#{@conference.call_for_papers.description}")
expect(view.content_for(:splash)).to include("#{@conference.call_for_papers.description}")
end
it 'renders sponsors partial' do
expect(view).to render_template(partial: 'conference/_sponsor')
expect(rendered).to include('Lorem Ipsum Dolor')
expect(rendered).to include('example@example.com')
expect(rendered).to include('Platin')
expect(rendered).to include('Example sponsor')
expect(rendered).to include('http://www.example.com')
expect(rendered).to include('Lorem Ipsum Dolor')
expect(rendered).to include('rails.jpg')
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')
end
it 'renders social media partial' do
expect(view).to render_template('conference/_social_media')
expect(rendered).to include('http://www.fbexample.com')
expect(rendered).to include('http://www.google-example.com')
expect(rendered).to include('http://youtu.be/rtyutut')
expect(view.content_for(:splash)).to include('http://www.fbexample.com')
expect(view.content_for(:splash)).to include('http://www.google-example.com')
expect(view.content_for(:splash)).to include('http://youtu.be/rtyutut')
end
it 'renders location partial' do
expect(view).to render_template(partial: 'conference/_location')
expect(rendered).to include('Suse Office')
expect(rendered).to include('Maxfeldstrasse 5 \n90409 Nuremberg')
expect(rendered).to include('www.opensuse.org')
expect(rendered).to include('Lorem Ipsum Dolor')
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')
end
it 'renders lodging partial' do
expect(view).to render_template(partial: 'conference/_lodging')
expect(rendered).to include('Example Hotel')
expect(rendered).to include('Lorem Ipsum Dolor')
expect(rendered).to include('http://www.example.com')
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')
end
end