Added lodging to splash view

This commit is contained in:
Gopesh Tulsyan 2014-06-07 00:30:19 +05:30
parent 4cc039b358
commit c1063645da
13 changed files with 53 additions and 5 deletions

View file

@ -4,6 +4,7 @@ FactoryGirl.define do
factory :lodging do
name 'Example Hotel'
description 'Lorem Ipsum Dolor'
website_link 'http://www.example.com'
venue
end
end

View file

@ -25,7 +25,9 @@ feature Lodging do
find('div.nested-fields:nth-of-type(1) div:nth-of-type(2) textarea').
set('Lorem Ipsum Dolor')
attach_file 'Photo', path
page.
find('div.nested-fields:nth-of-type(1) div:nth-of-type(4) input').
set('http://www.example.com')
click_button 'Update Venue'
# Validations
@ -34,6 +36,8 @@ feature Lodging do
value).to eq('Example Hotel')
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(2) textarea').
value).to eq('Lorem Ipsum Dolor')
expect(find('div.nested-fields:nth-of-type(1) div:nth-of-type(4) input').
value).to eq('http://www.example.com')
expect(page).to have_selector("img[src*='rails.png']")
# Remove room

View file

@ -9,5 +9,6 @@ describe 'admin/lodgings/index' do
render
expect(rendered).to include('Example Hotel')
expect(rendered).to include('Lorem Ipsum Dolor')
expect(rendered).to include('http://www.example.com')
end
end

View file

@ -6,6 +6,7 @@ describe 'conference/show.html.haml' do
registration_end_date: Date.tomorrow,
description: 'Lorem Ipsum')
@conference.venue = create(:venue)
@conference.venue.lodgings << create(:lodging, venue: @conference.venue)
@conference.call_for_papers = create(:call_for_papers, conference: @conference)
assign :conference, @conference
render
@ -33,4 +34,11 @@ describe 'conference/show.html.haml' do
expect(rendered).to include('www.opensuse.org')
expect(rendered).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')
end
end