Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "test added"
This reverts commit 3a76cc7.
  • Loading branch information
rajat315315 committed Mar 5, 2021
commit f0413bee81561048c516a7d3aa1592cd2a5613c3
10 changes: 5 additions & 5 deletions caddytest/integration/map_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ func TestMap(t *testing.T) {

map {http.request.method} {dest-1} {dest-2} {
default unknown1 unknown2
~G([\w]+) G{http.regexp.1} called
POST post-called
~G.T get-called
POST post-called foobar
}

respond /version 200 {
body "hello from localhost {dest-1} {dest-2}"
}
}
}
`, "caddyfile")

// act and assert
tester.AssertGetResponse("http://localhost:9080/version", 200, "hello from localhost GET called")
tester.AssertPostResponseBody("http://localhost:9080/version", []string{}, bytes.NewBuffer([]byte{}), 200, "hello from localhost post-called unknown2")
tester.AssertGetResponse("http://localhost:9080/version", 200, "hello from localhost get-called unknown2")
tester.AssertPostResponseBody("http://localhost:9080/version", []string{}, bytes.NewBuffer([]byte{}), 200, "hello from localhost post-called foobar")
}

func TestMapRespondWithDefault(t *testing.T) {
Expand Down