0
@@ -112,6 +112,15 @@ begin
0
+ class ControllerWhichFails < ActionController::Base
0
# you can't use asset_recognize, because it can't pass parameters in to the requests
0
class UrlRecognitionTests < Test::Unit::TestCase
0
def test_detects_in_canvas
0
@@ -949,6 +958,36 @@ class RailsFacebookFormbuilderTest < Test::Unit::TestCase
0
assert_equal "<fb:editor-custom label=\"Friends\"></fb:editor-custom>",@form_builder.multi_friend_input
0
+class RailsPrettyErrorsTest < Test::Unit::TestCase
0
+ ENV['FACEBOOK_API_KEY'] = '1234567'
0
+ ENV['FACEBOOK_SECRET_KEY'] = '7654321'
0
+ @controller = ControllerWhichFails.new
0
+ @request = ActionController::TestRequest.new
0
+ @response = ActionController::TestResponse.new
0
+ @controller.stubs(:verify_signature).returns(true)
0
+ def test_pretty_errors
0
+ Facebooker.facebooker_config.stubs(:pretty_errors).returns(false)
0
+ post :pass, example_rails_params_including_fb
0
+ assert_response :success
0
+ post :fail, example_rails_params_including_fb
0
+ assert_response :error
0
+ Facebooker.facebooker_config.stubs(:pretty_errors).returns(true)
0
+ post :pass, example_rails_params_including_fb
0
+ assert_response :success
0
+ post :fail, example_rails_params_including_fb
0
+ assert_response :error
0
+ def example_rails_params_including_fb
0
+ {"fb_sig_time"=>"1186588275.5988", "fb_sig"=>"7371a6400329b229f800a5ecafe03b0a", "action"=>"index", "fb_sig_in_canvas"=>"1", "fb_sig_session_key"=>"c452b5d5d60cbd0a0da82021-744961110", "controller"=>"controller_which_requires_facebook_authentication", "fb_sig_expires"=>"0", "fb_sig_friends"=>"417358,702720,1001170,1530839,3300204,3501584,6217936,9627766,9700907,22701786,33902768,38914148,67400422,135301144,157200364,500103523,500104930,500870819,502149612,502664898,502694695,502852293,502985816,503254091,504510130,504611551,505421674,509229747,511075237,512548373,512830487,517893818,517961878,518890403,523589362,523826914,525812984,531555098,535310228,539339781,541137089,549405288,552706617,564393355,564481279,567640762,568091401,570201702,571469972,573863097,574415114,575543081,578129427,578520568,582262836,582561201,586550659,591631962,592318318,596269347,596663221,597405464,599764847,602995438,606661367,609761260,610544224,620049417,626087078,628803637,632686250,641422291,646763898,649678032,649925863,653288975,654395451,659079771,661794253,665861872,668960554,672481514,675399151,678427115,685772348,686821151,687686894,688506532,689275123,695551670,710631572,710766439,712406081,715741469,718976395,719246649,722747311,725327717,725683968,725831016,727580320,734151780,734595181,737944528,748881410,752244947,763868412,768578853,776596978,789728437,873695441", "fb_sig_added"=>"0", "fb_sig_api_key"=>"b6c9c857ac543ca806f4d3187cd05e09", "fb_sig_user"=>"744961110", "fb_sig_profile_update_time"=>"1180712453"}
0
# $stderr.puts "Couldn't find action controller. That's OK. We'll skip it."
Comments
No one has commented yet.