Skip to content
This repository was archived by the owner on Mar 30, 2024. It is now read-only.

Commit f46a3ba

Browse files
committed
Simplify tests
1 parent 91380c3 commit f46a3ba

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nginx/conf.d/api-gateway.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ server {
88
}
99

1010
location /path1 {
11-
set $backend_upstream "https://service2.myapi.com/v1/path1";
11+
set $backend_upstream "https://service1.myapi.com/v1/path1";
1212
proxy_pass $backend_upstream;
1313
}
1414

1515
location ~ ^/path1/(?<id>.*)$ {
16-
set $backend_upstream "https://service1.myapi.com/v1/path1/";
16+
set $backend_upstream "https://service2.myapi.com/v1/path1/";
1717
proxy_pass $backend_upstream$id;
1818
}
1919

tests/spec/gateway_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
expect(result.code).to eq(200)
1919
end
2020
it "proxy to service2" do
21-
expect(result.body).to eq("https://service2.myapi.com/v1/path1")
21+
expect(result.body).to eq("https://service1.myapi.com/v1/path1")
2222
end
2323
it "response header does not contain nginx version" do
2424
expect(result.headers[:server]).to eq("nginx")
@@ -31,7 +31,7 @@
3131
expect(result.code).to eq(200)
3232
end
3333
it "proxy to service1" do
34-
expect(result.body).to eq("https://service1.myapi.com/v1/path1/some_id")
34+
expect(result.body).to eq("https://service2.myapi.com/v1/path1/some_id")
3535
end
3636
it "response header does not contain nginx version" do
3737
expect(result.headers[:server]).to eq("nginx")

0 commit comments

Comments
 (0)