Skip to content

Commit

Permalink
chore: add test for connection trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra committed Oct 18, 2024
1 parent 69a05df commit 90b3368
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions context/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ var _ = ginkgo.Describe("Connection Tests", func() {
},
expect: "postgres://the-username:the-password@localhost:5443/mission_control",
},
{
name: "space and newline trimming",
connection: models.Connection{
URL: `
postgres://$(username):$(password)@$(properties.host):$(properties.port)/$(properties.database)
`,
Username: " the-username",
Password: "the-password ",
Properties: map[string]string{
"host": "localhost",
"database": "mission_control",
"port": "5443",
},
},
expect: "postgres://the-username:the-password@localhost:5443/mission_control",
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 90b3368

Please sign in to comment.