Skip to content

Commit

Permalink
Merge pull request #64 from intercom/jo/remove-admin_id-constraint-on…
Browse files Browse the repository at this point in the history
…-note

remove requirement of admin_id from note creation
  • Loading branch information
josler committed Dec 9, 2014
2 parents fcb906f + accf6c4 commit d4887f9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changes
=========

1.0.0-b7

- Removed requirement for admin_id on note creation

1.0.0-b6

- Added rate limit details to response, thanks @ziemkowski
Expand Down Expand Up @@ -29,4 +33,4 @@ Changes

1.0.0-b1

- initial beta release
- initial beta release
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In your composer.json file:
```js
{
"require": {
"intercom/intercom-php": "1.0.0-b5"
"intercom/intercom-php": "1.0.0-b7"
}
}
```
Expand Down
1 change: 0 additions & 1 deletion src/Intercom/Service/config/intercom_public_note.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"parameters": {
"admin_id": {
"location": "json",
"required": true,
"type": "string"
},
"user": {
Expand Down
10 changes: 9 additions & 1 deletion tests/Intercom/Resources/NoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ public function testCreateNote()
$this->assertRequestJson(['admin_id' => '6', 'user' => ['email' => '[email protected]'], 'body' => 'Hi']);
}

public function testCreateNoteWithoutAdmin() {
$this->setMockResponse($this->client, 'Note/Note.txt');
$this->client->createNote(['user' => ['email' => '[email protected]'], 'body' => 'Hi']);

$this->assertRequest('POST', '/notes');
$this->assertRequestJson(['user' => ['email' => '[email protected]'], 'body' => 'Hi']);
}

/**
* @expectedException \Guzzle\Service\Exception\ValidationException
*/
Expand Down Expand Up @@ -94,4 +102,4 @@ public function testCreateNoteNoBody()
{
$this->client->getNote(['admin_id' => '6', 'user' => ['email' => '[email protected]']]);
}
}
}

0 comments on commit d4887f9

Please sign in to comment.