From 0806fcc7d477b45d158e8a152b1f927f395d3aa7 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Sun, 3 Jun 2012 14:28:43 +0100 Subject: File.dirname(__FILE__) is not necessarily absolute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s weird that there’s so much code here that implicitly assumes File.dirname(__FILE__) is an absolute path, because really in general it very much is not! This assumption was invalidated by the recent bundler-awareness changes. --- spec/integration/errors_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/integration/errors_spec.rb') diff --git a/spec/integration/errors_spec.rb b/spec/integration/errors_spec.rb index ec2e1c376..4424b58c6 100644 --- a/spec/integration/errors_spec.rb +++ b/spec/integration/errors_spec.rb @@ -33,7 +33,7 @@ describe "When rendering errors" do end it "should render a 403 for attempts at directory listing for attachments" do # make a fake cache - foi_cache_path = File.join(File.dirname(__FILE__), '../../cache') + foi_cache_path = File.expand_path(File.join(File.dirname(__FILE__), '../../cache')) FileUtils.mkdir_p(File.join(foi_cache_path, "views/en/request/101/101/response/1/attach/html/1")) get("/request/101/response/1/attach/html/1/" ) response.code.should == "403" -- cgit v1.2.3