Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Add test for #974
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdriscoll committed Jul 30, 2019
1 parent d03c611 commit 8c00adc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/UniversalDashboard.UITest/Integration/Api.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,29 @@ Describe "Api" {
$body
}

New-UDEndpoint -Url "/group/:id" -Method "GET" -Endpoint {
param($id)

$id
}
New-UDEndpoint -Url "/group/:id/memberOf" -Method "GET" -Endpoint {
param($id)

"memberOf$id"
}
) -EndpointInitialization $Init


New-UDEndpoint -Url "/afterstartup" -Method "GET" -Endpoint {
"After Startup"
}

It "should work with nested routes" {
Invoke-RestMethod -Uri 'http://localhost:10001/api/recherches/1' -Method DELETE | Should be "1"
Invoke-RestMethod -Uri 'http://localhost:10001/api/recherches/2/activate' -Method DELETE | Should be "2"
Invoke-RestMethod -Uri 'http://localhost:10001/api/group/1' -Method GET | Should be "1"
Invoke-RestMethod -Uri 'http://localhost:10001/api/group/1/memberOf' -Method GET | Should be "memberOf1"

}

It "should process int correctly" {
Expand Down

0 comments on commit 8c00adc

Please sign in to comment.