Commit ce97bead authored by Terence Lee's avatar Terence Lee

change tests to fit more inline with repo current way of testing

- separate redirect + redirect interpolation changes
- use env hash inside test and don't hardcode in app_runner.rb
parent e7e98bd5
......@@ -3,10 +3,6 @@
"/old/gone": {
"url": "/",
"status": 302
},
"/old/interpolation": {
"url": "${INTERPOLATED_URL}",
"status": 302
}
}
}
{
"redirects": {
"/old/gone": {
"url": "/",
"status": 302
},
"/old/interpolation": {
"url": "${INTERPOLATED_URL}",
"status": 302
}
}
}
......@@ -90,12 +90,20 @@ RSpec.describe "Simple" do
expect(response["location"]).to eq("http://#{AppRunner::HOST_IP}/")
end
context "interpolation" do
let(:name) { "redirects_interpolation" }
let(:env) {
{ "INTERPOLATED_URL" => "/interpolation.html" }
}
it "should redirect using interpolated urls" do
response = app.get("/old/interpolation")
expect(response.code).to eq("302")
expect(response["location"]).to eq("http://#{AppRunner::HOST_IP}/interpolation.html")
end
end
end
describe "https only" do
let(:name) { "https_only" }
......
......@@ -24,9 +24,6 @@ class AppRunner
@debug = debug
env.merge!("STATIC_DEBUG" => true) if @debug
# support interpolation specs
env.merge!("INTERPOLATED_URL" => "/interpolation.html")
@container = Docker::Container.create(
"Image" => BuildpackBuilder::TAG,
"Cmd" => ["bash", "-c", "cp -rf /src/* /app/ && /app/bin/boot"],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment