mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-05 23:44:22 +00:00
Add commit name and commit email to workspace model
This commit is contained in:
@@ -69,6 +69,8 @@ func TestWorkspaceOperations(t *testing.T) {
|
||||
GitToken: "secret-token",
|
||||
GitAutoCommit: true,
|
||||
GitCommitMsgTemplate: "${action} ${filename}",
|
||||
GitCommitName: "Test User",
|
||||
GitCommitEmail: "test@example.com",
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
@@ -244,6 +246,8 @@ func TestWorkspaceOperations(t *testing.T) {
|
||||
workspace.GitToken = "new-token"
|
||||
workspace.GitAutoCommit = true
|
||||
workspace.GitCommitMsgTemplate = "custom ${filename}"
|
||||
workspace.GitCommitName = "Test User"
|
||||
workspace.GitCommitEmail = "test@example.com"
|
||||
|
||||
if err := database.UpdateWorkspace(workspace); err != nil {
|
||||
t.Fatalf("failed to update workspace: %v", err)
|
||||
@@ -424,6 +428,12 @@ func verifyWorkspace(t *testing.T, actual, expected *models.Workspace) {
|
||||
if actual.GitCommitMsgTemplate != expected.GitCommitMsgTemplate {
|
||||
t.Errorf("GitCommitMsgTemplate = %v, want %v", actual.GitCommitMsgTemplate, expected.GitCommitMsgTemplate)
|
||||
}
|
||||
if actual.GitCommitName != expected.GitCommitName {
|
||||
t.Errorf("GitCommitName = %v, want %v", actual.GitCommitName, expected.GitCommitName)
|
||||
}
|
||||
if actual.GitCommitEmail != expected.GitCommitEmail {
|
||||
t.Errorf("GitCommitEmail = %v, want %v", actual.GitCommitEmail, expected.GitCommitEmail)
|
||||
}
|
||||
if actual.CreatedAt.IsZero() {
|
||||
t.Error("CreatedAt should not be zero")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user