]> git.openstreetmap.org Git - rails.git/blob - test/functional/export_controller_test.rb
Add a test for commenting on diary entries
[rails.git] / test / functional / export_controller_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2
3 class ExportControllerTest < ActionController::TestCase
4
5   ##
6   # test all routes which lead to this controller
7   def test_routes
8     assert_routing(
9       { :path => "/export/start", :method => :get },
10       { :controller => "export", :action => "start" }
11     )
12     assert_routing(
13       { :path => "/export/finish", :method => :post },
14       { :controller => "export", :action => "finish" }
15     )
16     assert_routing(
17       { :path => "/export/embed", :method => :get },
18       { :controller => "export", :action => "embed" }
19     )
20   end
21
22   def test_start
23     xhr :get, :start
24     assert_response :success
25     assert_template 'export/start'
26   end
27   
28   def test_finish_osm
29     get :finish, {:minlon => 0, :minlat => 50, :maxlon => 1, :maxlat => 51, :format => 'osm'}
30     assert_response :redirect
31   end
32   
33   def test_finish_mapnik
34     get :finish, {:minlon => 0, :minlat => 50, :maxlon => 1, :maxlat => 51, :format => 'mapnik', :mapnik_format => 'test', :mapnik_scale => '12'}
35     assert_response :redirect
36   end
37
38 end