adopt-a-hydrant/test/functional/main_controller_test.rb

27 lines
912 B
Ruby
Raw Normal View History

2011-05-15 22:07:53 +00:00
require 'test_helper'
class MainControllerTest < ActionController::TestCase
test 'should return the home page' do
get :index
assert_response :success
assert_select 'title', 'Adopt a Hydrant'
assert_select 'h1', 'Adopt a Hydrant'
assert_select 'p#tagline', 'Claim responsibility for shoveling out a fire hydrant after it snows.'
assert_select 'form' do
assert_select '[action=?]', '/'
assert_select '[method=?]', 'post'
end
assert_select 'label#city_state_label', 'City'
assert_select 'select#city_state' do
assert_select 'option', 'Boston, MA'
end
assert_select 'label#address_label', 'Address, Neighborhood'
2011-05-15 22:07:53 +00:00
assert_select 'input#address', true
assert_select 'input[name="commit"]' do
assert_select '[type=?]', 'submit'
assert_select '[value=?]', 'Find fire hydrants'
end
assert_select 'div#map_canvas', true
end
end