From c5c5524593c2394284ad3568b7625021884c6eaa Mon Sep 17 00:00:00 2001 From: Kaustubh Nair Date: Thu, 16 May 2019 21:55:13 +0530 Subject: [PATCH] Add tests for images --- test/functional/images_controller_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/functional/images_controller_test.rb b/test/functional/images_controller_test.rb index 75f1bf71d..e8c558361 100644 --- a/test/functional/images_controller_test.rb +++ b/test/functional/images_controller_test.rb @@ -56,6 +56,7 @@ def fetch_in_production points = "-71.39,41.83:-71.39,41.83:-71.39,41.83:-71.39,41.83" put :update, id: @map.id, warpable_id: @warp.id, locked: false, points: points assert_not_nil @warp.nodes + assert_equal 'success', response.body assert_equal "text/html", response.content_type end @@ -72,4 +73,18 @@ def fetch_in_production assert_redirected_to '/login' assert_not_nil flash[:error] end + + # Imports don't work. Relevent issue: https://github.com/publiclab/mapknitter/issues/614 +# test 'should import an image' do +# get :import, name: @map.name, url: 'https://edit.co.uk/uploads/2016/12/Image-2-Alternatives-to-stock-photography-Thinkstock.jpg' +# assert_response :redirect +# assert_redirected_to '/maps/' + @map.name +# end + +# test 'should display error if import failed' do +# get :import, name: @map.name, url: 'fake url' +# assert_response :redirect +# assert_redirected_to '/map/edit/' + @map.name +# assert_not_nil flash[:notice] +# end end