Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

Commit

Permalink
Rename kudos and comments Post to Create
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmach committed Jun 1, 2014
1 parent 54e8b66 commit 3c9ee9f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion comments.go
Expand Up @@ -84,7 +84,7 @@ type ActivityCommentsPostCall struct {
text string
}

func (s *ActivityCommentsService) Post(text string) *ActivityCommentsPostCall {
func (s *ActivityCommentsService) Create(text string) *ActivityCommentsPostCall {
return &ActivityCommentsPostCall{
service: s,
text: text,
Expand Down
8 changes: 4 additions & 4 deletions comments_test.go
Expand Up @@ -76,9 +76,9 @@ func TestActivityCommentsList(t *testing.T) {
}
}

func TestActivityCommentsPost(t *testing.T) {
func TestActivityCommentsCreate(t *testing.T) {
client := newCassetteClient(testToken, "activity_comments_post")
comment, err := NewActivityCommentsService(client, 118293263).Post("test comment").Do()
comment, err := NewActivityCommentsService(client, 118293263).Create("test comment").Do()

if err != nil {
t.Fatalf("service error: %v", err)
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestActivityCommentsPost(t *testing.T) {
s := NewActivityCommentsService(newStoreRequestClient(), 123)

// path
s.Post("test comment").Do()
s.Create("test comment").Do()

transport := s.client.httpClient.Transport.(*storeRequestTransport)
if transport.request.URL.Path != "/api/v3/activities/123/comments" {
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestActivityCommentsBadJSON(t *testing.T) {
t.Error("should return a bad json error")
}

_, err = s.Post("abc").Do()
_, err = s.Create("abc").Do()
if err == nil {
t.Error("should return a bad json error")
}
Expand Down
2 changes: 1 addition & 1 deletion kudos.go
Expand Up @@ -63,7 +63,7 @@ type ActivityKudosPostCall struct {
service *ActivityKudosService
}

func (s *ActivityKudosService) Post() *ActivityKudosPostCall {
func (s *ActivityKudosService) Create() *ActivityKudosPostCall {
return &ActivityKudosPostCall{
service: s,
}
Expand Down
6 changes: 3 additions & 3 deletions kudos_test.go
Expand Up @@ -48,9 +48,9 @@ func TestActivitiesKudosList(t *testing.T) {
}
}

func TestActivityKudosPost(t *testing.T) {
func TestActivityKudosCre(t *testing.T) {
client := newCassetteClient(testToken, "activity_kudos_post")
err := NewActivityKudosService(client, 118229063).Post().Do()
err := NewActivityKudosService(client, 118229063).Create().Do()

if err != nil {
t.Fatalf("service error: %v", err)
Expand All @@ -60,7 +60,7 @@ func TestActivityKudosPost(t *testing.T) {
s := NewActivityKudosService(newStoreRequestClient(), 123)

// path
s.Post().Do()
s.Create().Do()

transport := s.client.httpClient.Transport.(*storeRequestTransport)
if transport.request.URL.Path != "/api/v3/activities/123/kudos" {
Expand Down

0 comments on commit 3c9ee9f

Please sign in to comment.