Skip to content

Commit

Permalink
Code edits - adds tests
Browse files Browse the repository at this point in the history
Adds tests for contact details and updates relevant location details
cassette.
  • Loading branch information
anselmbradford committed Aug 3, 2014
1 parent 1657d5d commit cd19ad3
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 135 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 37 additions & 10 deletions spec/features/details/location_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
end
end

it 'includes the Contact header' do
it 'includes the section header' do
expect(page).to have_content('General Contact Info')
end

Expand Down Expand Up @@ -117,7 +117,7 @@
end

it 'includes updated time' do
expect(page).to have_content('Thursday, 22 May 2014 at 5:31 PM PDT')
expect(page).to have_content('Saturday, 2 August 2014 at 8:51 PM PDT')
end

end
Expand Down Expand Up @@ -157,14 +157,6 @@
expect(page).to have_content('Disabled Parking')
end

it 'includes contact name' do
expect(page).to have_content('Suzanne Badenhoop')
end

it 'includes contact title' do
expect(page).to have_content('Board President')
end

it 'includes email info' do
expect(page).to have_link('sanmaceo@co.sanmaceo.ca.us')
end
Expand All @@ -188,7 +180,42 @@
it 'sets the page title to the location name + site title' do
expect(page).to have_title('San Maceo Agency | Ohana Web Search')
end
end

context 'when Contact elements are present' do
before(:each) do
VCR.use_cassette('location_details/when_the_details_page_is_visited_directly') do
visit_test_location
end
end

it 'includes the contact section header' do
expect(page).to have_content('Specific Contact')
end

it 'includes contact name' do
expect(page).to have_content('Suzanne Badenhoop')
end

it 'includes contact title' do
expect(page).to have_content('Board President')
end

it 'includes contact email' do
expect(page).to have_content('suzanne@example.com')
end

it 'includes contact phone' do
expect(page).to have_content('(123) 456-7890')
end

it 'includes contact phone extension' do
expect(page).to have_content('x1200')
end

it 'includes contact fax' do
expect(page).to have_content('(202) 555-1212')
end
end

describe 'Edit link' do
Expand Down

0 comments on commit cd19ad3

Please sign in to comment.