aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/request_controller.rb2
-rw-r--r--spec/controllers/request_controller_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 4b7884065..1801648ca 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -774,7 +774,7 @@ class RequestController < ApplicationController
:email => _("Then you can download a zip file of {{info_request_title}}.",:info_request_title=>info_request.title),
:email_subject => _("Log in to download a zip file of {{info_request_title}}",:info_request_title=>info_request.title)
)
- updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_s + info_request.updated_at.to_s)
+ updated = Digest::SHA1.hexdigest(info_request.get_last_event.created_at.to_i.to_s + info_request.updated_at.to_i.to_s)
@url_path = "/download/#{updated[0..1]}/#{updated}/#{params[:url_title]}.zip"
file_path = File.join(File.dirname(__FILE__), '../../cache/zips', @url_path)
if !File.exists?(file_path)
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 8e1e4589f..fe9a6a99e 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require 'json'
@@ -239,11 +240,10 @@ describe RequestController, "when showing one request" do
get :download_entire_request, :url_title => title
assigns[:url_path].should have_text(/#{title}.zip$/)
response.location.should have_text(/#{assigns[:url_path]}/)
- assigns[:url_path].should_not == old_path
zipfile = Zip::ZipFile.open(File.join(File.dirname(__FILE__), "../../cache/zips", assigns[:url_path])) { |zipfile|
zipfile.count.should == 4
-zipfile.entries.each {|x| puts x.name}
}
+ assigns[:url_path].should_not == old_path
end
end
end