2011-09-15 21:41:26 +00:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class ThingsControllerTest < ActionController::TestCase
|
|
|
|
setup do
|
|
|
|
@thing = things(:thing_1)
|
|
|
|
end
|
|
|
|
|
2011-10-23 20:22:15 +00:00
|
|
|
test 'should list hydrants' do
|
2012-06-18 17:49:28 +00:00
|
|
|
get :show, format: 'json', lat: 42.358431, lng: -71.059773
|
2011-10-23 20:22:15 +00:00
|
|
|
assert_not_nil assigns :things
|
|
|
|
assert_response :success
|
|
|
|
end
|
2011-09-15 21:41:26 +00:00
|
|
|
|
|
|
|
test 'should update hydrant' do
|
|
|
|
assert_not_equal 'Birdsill', @thing.name
|
2012-06-18 17:49:28 +00:00
|
|
|
put :update, format: 'json', id: @thing.id, thing: {name: 'Birdsill'}
|
2011-09-15 21:41:26 +00:00
|
|
|
@thing.reload
|
|
|
|
assert_equal 'Birdsill', @thing.name
|
|
|
|
assert_not_nil assigns :thing
|
|
|
|
assert_response :success
|
|
|
|
end
|
|
|
|
end
|