-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:adlio/trello
* 'master' of github.com:adlio/trello: [add and remove label] Label API support Set client on cards when getting lists
- Loading branch information
Showing
7 changed files
with
130 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright © 2016 Aaron Longwell | ||
// | ||
// Use of this source code is governed by an MIT licese. | ||
// Details in the LICENSE file. | ||
|
||
package trello | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
|
||
func TestGetLabel(t *testing.T) { | ||
label := testLabel(t) | ||
if label.Name != "Visited" { | ||
t.Errorf("Title incorrect. Got '%s'", label.Name) | ||
} | ||
} | ||
|
||
func TestGetLabelsOnBoard(t *testing.T) { | ||
board := testBoard(t) | ||
board.client.BaseURL = mockResponse("labels", "board-labels-api-example.json").URL | ||
lists, err := board.GetLabels(Defaults()) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
if len(lists) != 3 { | ||
t.Errorf("Expected 3 labels, got %d", len(lists)) | ||
} | ||
} | ||
|
||
// Utility function to get the standard case Client.GetList() response | ||
// | ||
func testLabel(t *testing.T) *Label { | ||
c := testClient() | ||
c.BaseURL = mockResponse("labels", "labels-api-example.json").URL | ||
label, err := c.GetLabel("4eea4ff", Defaults()) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
return label | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"id": "57a890c6504676888e1dd747", | ||
"name": "Verified on branch", | ||
"color": "yellow" | ||
}, | ||
{ | ||
"id": "57a890c6504676888e1dd74a", | ||
"name": "Regression", | ||
"color": "purple" | ||
}, | ||
{ | ||
"id": "57a890c6504676888e1dd74b", | ||
"name": "Verified on staging", | ||
"color": "blue" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"id": "560bf42919ad3a5dc29f33c5", | ||
"idBoard": "560bf4298b3dda300c18d09c", | ||
"name": "Visited", | ||
"color": "green" | ||
} |