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

24 lines
688 B
Ruby
Raw Normal View History

2011-05-16 06:32:46 +00:00
require 'test_helper'
class HydrantsControllerTest < ActionController::TestCase
setup do
@hydrant = hydrants(:hydrant_1)
end
# test 'should list hydrants' do
# skip 'Cannot test query on sqlite3 test database'
2011-05-31 11:12:02 +00:00
# get :show, :format => 'json', :lat => 42.358431, :lng => -71.059773
2011-05-16 06:32:46 +00:00
# assert_not_nil assigns :hydrants
# assert_response :success
# end
test 'should update hydrant' do
assert_not_equal 'Birdsill', @hydrant.name
put :update, :format => 'json', :id => @hydrant.id, :hydrant => {:name => 'Birdsill'}
@hydrant.reload
assert_equal 'Birdsill', @hydrant.name
assert_not_nil assigns :hydrant
assert_response :success
end
end