Skip to content
Open
Changes from all commits
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
10 changes: 10 additions & 0 deletions Tests/New-HipchatRoom.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ Describe "New-HipchatRoom" {

Context "When the API call is sent" {

Mock Invoke-WebRequest {
[pscustomobject]@{
StatusCode = 201
}
}

It "Should return a 201 Status Code" {
New-HipchatRoom -Name 'PesterTest' -Private -ApiToken $ApiToken |
Should Be '201'
}

It 'Should use Invoke-WebRequest only 1 time' {
Assert-MockCalled Invoke-WebRequest -Times 1 -Exactly
}
}

AfterAll {
Expand Down