Trying to fix specs when run on Travis

This commit is contained in:
Garret Alfert 2016-02-01 18:04:35 +01:00
parent 9ba85446ef
commit 409628c9e7
4 changed files with 20 additions and 13 deletions

View File

@ -32,6 +32,11 @@ test:
cs_binaries: rs.binaries.test
authorizations: rs_authorizations_test
opslog: rs_opslog_test
swift:
host: "https://swift.example.com"
redis:
host: localhost
port: 6379
staging:
<<: *defaults

View File

@ -251,7 +251,7 @@ describe "Directories" do
context "charset given in content-type header" do
before do
header "Content-Type", "image/jpeg; charset=binary"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/tasks/jaypeg.jpg", @image
end
@ -273,7 +273,7 @@ describe "Directories" do
context "no charset in content-type header" do
before do
header "Content-Type", "image/jpeg"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/tasks/jaypeg.jpg", @image
end

View File

@ -446,7 +446,7 @@ describe "App with Riak backend" do
context "binary charset in content-type header" do
before do
header "Content-Type", "image/jpeg; charset=binary"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/documents/jaypeg", @image
end
@ -502,7 +502,7 @@ describe "App with Riak backend" do
context "overwriting existing file with same file" do
before do
header "Content-Type", "image/jpeg; charset=binary"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/documents/jaypeg", @image
end
@ -518,7 +518,7 @@ describe "App with Riak backend" do
context "overwriting existing file with different file" do
before do
header "Content-Type", "image/jpeg; charset=binary"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/documents/jaypeg", @image+"foo"
end
@ -540,7 +540,7 @@ describe "App with Riak backend" do
context "no binary charset in content-type header" do
before do
header "Content-Type", "image/jpeg"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/documents/jaypeg", @image
end
@ -705,7 +705,7 @@ describe "App with Riak backend" do
context "binary data" do
before do
header "Content-Type", "image/jpeg; charset=binary"
filename = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", "rockrule.jpeg")
filename = File.join(File.expand_path(File.dirname(__FILE__)), "..", "fixtures", "rockrule.jpeg")
@image = File.open(filename, "r").read
put "/jimmy/documents/jaypeg", @image

View File

@ -33,14 +33,16 @@ end
alias context describe
def redis
if app.settings.respond_to? :redis
def redis
@redis ||= Redis.new(host: app.settings.redis["host"], port: app.settings.redis["port"])
end
end
def purge_redis
def purge_redis
redis.keys("rs_*").each do |key|
redis.del key
end
end
end
if app.settings.respond_to? :riak