@@ -1065,15 +1065,15 @@ class CommunicationError < RuntimeError; end
10651065 end
10661066 it "should force txt without an extension" do
10671067 get '/meaning_of_life'
1068- last_response . body . should == "{ :meaning_of_life=>42}"
1068+ last_response . body . should == { :meaning_of_life => 42 } . to_s
10691069 end
10701070 it "should not force txt with an extension" do
10711071 get '/meaning_of_life.json'
1072- last_response . body . should == '{"meaning_of_life":42}'
1072+ last_response . body . should == { :meaning_of_life => 42 } . to_json
10731073 end
10741074 it "should force txt from a non-accepting header" do
10751075 get '/meaning_of_life' , { } , { 'HTTP_ACCEPT' => 'application/json' }
1076- last_response . body . should == "{ :meaning_of_life=>42}"
1076+ last_response . body . should == { :meaning_of_life => 42 } . to_s
10771077 end
10781078 end
10791079 context ":json" do
@@ -1085,15 +1085,15 @@ class CommunicationError < RuntimeError; end
10851085 end
10861086 it "should force json without an extension" do
10871087 get '/meaning_of_life'
1088- last_response . body . should == '{"meaning_of_life":42}'
1088+ last_response . body . should == { :meaning_of_life => 42 } . to_json
10891089 end
10901090 it "should not force json with an extension" do
10911091 get '/meaning_of_life.txt'
1092- last_response . body . should == "{ :meaning_of_life=>42}"
1092+ last_response . body . should == { :meaning_of_life => 42 } . to_s
10931093 end
10941094 it "should force json from a non-accepting header" do
10951095 get '/meaning_of_life' , { } , { 'HTTP_ACCEPT' => 'text/html' }
1096- last_response . body . should == '{"meaning_of_life":42}'
1096+ last_response . body . should == { :meaning_of_life => 42 } . to_json
10971097 end
10981098 end
10991099 end
0 commit comments