I have a Rails controller that sends a file with a different Content-Type
Exel-File example, Content-Type = "application/excel" controller set
and here is the RSpec test:
describe "GET getfile" do it "Excel File" do controller.stub(:render) controller.should_receive(:send_file) get :getfile, :name => 'test+xls' controller.response.header.should == '???' end end
Test Answer:
1) ExportController GET getfile Excel File Failure/Error: controller.response.header.should == '' expected: "" got: {"Content-Type"=>"text/html; charset=utf-8"} (using ==) Diff: @@ -1,2 +1,2 @@ -"" +"Content-Type" => "text/html; charset=utf-8"
romus source share