3 class SwfControllerTest < ActionController::TestCase
7 # test all routes which lead to this controller
10 { :path => "/api/0.6/swf/trackpoints", :method => :get },
11 { :controller => "swf", :action => "trackpoints" }
16 # basic test that trackpoints at least returns some sort of flash movie
18 get :trackpoints, :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1
19 assert_response :success
20 assert_equal "application/x-shockwave-flash", response.content_type
21 assert_match /^FWS/, response.body
22 assert_equal 80, response.body.length
24 get :trackpoints, :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1, :token => users(:normal_user).tokens.create.token
25 assert_response :success
26 assert_equal "application/x-shockwave-flash", response.content_type
27 assert_match /^FWS/, response.body
28 assert_equal 67, response.body.length
30 get :trackpoints, :xmin => -1, :xmax => 1, :ymin => 51, :ymax => 52, :baselong => 0, :basey => 0, :masterscale => 1, :token => users(:public_user).tokens.create.token
31 assert_response :success
32 assert_equal "application/x-shockwave-flash", response.content_type
33 assert_match /^FWS/, response.body
34 assert_equal 74, response.body.length