Skip to content

Commit

Permalink
Add tests for images
Browse files Browse the repository at this point in the history
  • Loading branch information
kaustubh-nair committed May 16, 2019
1 parent 7a1d6b0 commit c5c5524
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/functional/images_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit c5c5524

Please sign in to comment.