38 lines
1.2 KiB
Gherkin
38 lines
1.2 KiB
Gherkin
Feature: /new command — create a Claude Code session
|
|
|
|
Background:
|
|
Given user "user_abc123" is sending commands
|
|
|
|
Scenario: No arguments shows usage
|
|
When user sends "/new"
|
|
Then reply contains "Usage: /new"
|
|
|
|
Scenario: Creates session with valid directory
|
|
Given run_claude returns "Session ready."
|
|
When user sends "/new myproject"
|
|
Then reply contains "myproject"
|
|
And session manager has 1 session for user "user_abc123"
|
|
|
|
Scenario: Creates session with initial message
|
|
Given run_claude returns "Fixed the bug."
|
|
When user sends "/new myproject fix the login bug"
|
|
Then reply contains "myproject"
|
|
|
|
Scenario: Path traversal attempt is blocked
|
|
When user sends "/new ../../etc"
|
|
Then reply contains "Error"
|
|
And session manager has 0 sessions for user "user_abc123"
|
|
|
|
Scenario: Custom timeout is accepted
|
|
Given run_claude returns "Done."
|
|
When user sends "/new myproject --timeout 60"
|
|
Then reply contains "myproject"
|
|
And reply contains "timeout: 60s"
|
|
|
|
Scenario: Creates session and sends card when chat_id is set
|
|
Given the current chat_id is "chat_xyz"
|
|
And run_claude returns "Ready."
|
|
When user sends "/new myproject"
|
|
Then a sessions card is sent to chat "chat_xyz"
|
|
And text reply is empty
|