Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions internal/commands/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func NewMessageCmd() *cobra.Command {
if len(args) == 0 {
return missingArg(cmd, "<title>")
}
subject := args[0]
title := args[0]

// Body from second positional arg or --editor
var body string
Expand Down Expand Up @@ -589,7 +589,7 @@ func NewMessageCmd() *cobra.Command {
// Build SDK request
// Convert Markdown content to HTML for Basecamp's rich text fields
req := &basecamp.CreateMessageRequest{
Subject: subject,
Subject: title,
Content: richtext.MarkdownToHTML(body),
Subscriptions: subs,
}
Expand Down
10 changes: 5 additions & 5 deletions internal/commands/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ func TestMessagesListRequiresProject(t *testing.T) {
assert.Equal(t, "Project ID required", e.Message)
}

// TestMessagesCreateShowsHelpWithoutSubject tests that help is shown when --subject is missing.
func TestMessagesCreateShowsHelpWithoutSubject(t *testing.T) {
// TestMessagesCreateShowsHelpWithoutTitle tests that help is shown when title is missing.
func TestMessagesCreateShowsHelpWithoutTitle(t *testing.T) {
app, _ := setupMessagesTestApp(t)
app.Config.ProjectID = "123"

Expand Down Expand Up @@ -173,7 +173,7 @@ func TestMessagesUpdateRequiresID(t *testing.T) {
assert.Error(t, err)
}

// TestMessagesUpdateRequiresContent tests that messages update requires --subject or --content.
// TestMessagesUpdateShowsHelpWithoutContent tests that messages update requires --title or --body.
func TestMessagesUpdateShowsHelpWithoutContent(t *testing.T) {
app, _ := setupMessagesTestApp(t)
app.Config.ProjectID = "123"
Expand All @@ -184,8 +184,8 @@ func TestMessagesUpdateShowsHelpWithoutContent(t *testing.T) {
assert.NoError(t, err)
}

// TestMessageShortcutShowsHelpWithoutSubject tests that help is shown when --subject is missing.
func TestMessageShortcutShowsHelpWithoutSubject(t *testing.T) {
// TestMessageShortcutShowsHelpWithoutTitle tests that help is shown when title is missing.
func TestMessageShortcutShowsHelpWithoutTitle(t *testing.T) {
app, _ := setupMessagesTestApp(t)
app.Config.ProjectID = "123"

Expand Down
Loading