3 class ExportControllerTest < ActionController::TestCase
6 # test all routes which lead to this controller
9 { :path => "/export/finish", :method => :post },
10 { :controller => "export", :action => "finish" }
13 { :path => "/export/embed", :method => :get },
14 { :controller => "export", :action => "embed" }
19 # test the finish action for raw OSM data
21 get :finish, {:minlon => 0, :minlat => 50, :maxlon => 1, :maxlat => 51, :format => 'osm'}
22 assert_response :redirect
23 assert_redirected_to "http://api.openstreetmap.org/api/#{API_VERSION}/map?bbox=0.0,50.0,1.0,51.0"
27 # test the finish action for mapnik images
28 def test_finish_mapnik
29 get :finish, {:minlon => 0, :minlat => 50, :maxlon => 1, :maxlat => 51, :format => 'mapnik', :mapnik_format => 'test', :mapnik_scale => '12'}
30 assert_response :redirect
31 assert_redirected_to "http://render.openstreetmap.org/cgi-bin/export?bbox=0.0,50.0,1.0,51.0&scale=12&format=test"
35 # test the embed action
38 assert_response :success
39 assert_template "export/embed"