Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Commit

Permalink
Test that Flowdock errors on bad token.
Browse files Browse the repository at this point in the history
  • Loading branch information
xendk committed Feb 3, 2014
1 parent 6c9891a commit b311636
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/deployotronTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,14 +356,27 @@ public function testFlowdock() {
// Drush 5 needs to be kicked to see the new command.
$this->drush('cc', array('drush'), array(), NULL, $this->webroot());

// Check that deployment works.
// Run a deployment with Flowdock notification.
$this->drush('deploy 2>&1', array('@deployotron'), array('y' => TRUE, 'flowdock-token' => $this->flowdockToken), NULL, $this->webroot());
$this->assertRegExp('/HEAD now at fbcaa29d45716edcbedc3c325bfbab828f1ce838/', $this->getOutput());

// Check that we attempted to notify Flowdock.
$this->assertRegExp('/Sending Flowdock notification/', $this->getOutput());
// Check for error message.
$this->assertNotRegExp('/Unexpected response from Flowdock/', $this->getOutput());

// Test for generic error messages.
$this->assertNotRegExp('/\[error\]/', $this->getOutput());

// Try again with an invalid token.
$this->drush('deploy 2>&1', array('@deployotron'), array('y' => TRUE, 'flowdock-token' => 'badc0de'), NULL, $this->webroot());
$this->assertRegExp('/HEAD now at fbcaa29d45716edcbedc3c325bfbab828f1ce838/', $this->getOutput());

// Check that we attempted to notify Flowdock.
$this->assertRegExp('/Sending Flowdock notification/', $this->getOutput());
// Check for error message.
$this->assertRegExp('/Unexpected response from Flowdock/', $this->getOutput());

// Test for generic error messages.
$this->assertNotRegExp('/\[error\]/', $this->getOutput());
}
Expand Down

0 comments on commit b311636

Please sign in to comment.