Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-static
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-static
Commits
773c9e1b
Commit
773c9e1b
authored
Jun 03, 2015
by
Terence Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for proxying backends
parent
69b59258
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
index.html
spec/fixtures/proxies/public_html/foo/bar/index.html
+1
-0
simple_spec.rb
spec/simple_spec.rb
+32
-0
No files found.
spec/fixtures/proxies/public_html/foo/bar/index.html
0 → 100644
View file @
773c9e1b
api
spec/simple_spec.rb
View file @
773c9e1b
require
"fileutils"
require_relative
"spec_helper"
require_relative
"spec_helper"
require_relative
"support/app_runner"
require_relative
"support/app_runner"
require_relative
"support/buildpack_builder"
require_relative
"support/buildpack_builder"
require_relative
"support/path_helper"
RSpec
.
describe
"Simple"
do
RSpec
.
describe
"Simple"
do
before
(
:all
)
do
before
(
:all
)
do
...
@@ -79,4 +81,34 @@ RSpec.describe "Simple" do
...
@@ -79,4 +81,34 @@ RSpec.describe "Simple" do
expect
(
response
.
body
.
chomp
).
to
eq
(
"not found"
)
expect
(
response
.
body
.
chomp
).
to
eq
(
"not found"
)
end
end
end
end
describe
"proxies"
do
include
PathHelper
let
(
:name
)
{
"proxies"
}
let
(
:static_json_path
)
{
fixtures_path
(
"proxies/static.json"
)
}
before
do
File
.
open
(
static_json_path
,
"w"
)
do
|
file
|
file
.
puts
<<
STATIC_JSON
{
"proxies": {
"/api/": {
"origin": "http://
#{
AppRunner
::
HOST_IP
}
:
#{
AppRunner
::
HOST_PORT
}
/foo/"
}
}
}
STATIC_JSON
end
end
after
do
FileUtils
.
rm
(
static_json_path
)
end
it
"should proxy requests"
do
response
=
app
.
get
(
"/api/bar/"
)
expect
(
response
.
code
).
to
eq
(
"200"
)
expect
(
response
.
body
.
chomp
).
to
eq
(
"api"
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment