mirror of
https://github.com/chenasraf/cospend-cli.git
synced 2026-05-17 17:38:04 +00:00
fix: payment method & category field names
This commit is contained in:
@@ -301,11 +301,11 @@ func TestAddCommandWithAllFlags(t *testing.T) {
|
||||
if receivedBill["payedFor"] != "2,3" { // Alice and Bob
|
||||
t.Errorf("Wrong payedFor: %s", receivedBill["payedFor"])
|
||||
}
|
||||
if receivedBill["categoryid"] != "5" {
|
||||
t.Errorf("Wrong categoryid: %s", receivedBill["categoryid"])
|
||||
if receivedBill["categoryId"] != "5" {
|
||||
t.Errorf("Wrong categoryid: %s", receivedBill["categoryId"])
|
||||
}
|
||||
if receivedBill["paymentmodeid"] != "3" {
|
||||
t.Errorf("Wrong paymentmodeid: %s", receivedBill["paymentmodeid"])
|
||||
if receivedBill["paymentModeId"] != "3" {
|
||||
t.Errorf("Wrong paymentmodeid: %s", receivedBill["paymentModeId"])
|
||||
}
|
||||
if receivedBill["comment"] != "Team dinner" {
|
||||
t.Errorf("Wrong comment: %s", receivedBill["comment"])
|
||||
|
||||
@@ -359,10 +359,10 @@ func (c *Client) CreateBill(projectID string, bill Bill) error {
|
||||
data.Set("comment", bill.Comment)
|
||||
}
|
||||
if bill.PaymentModeID != 0 {
|
||||
data.Set("paymentmodeid", strconv.Itoa(bill.PaymentModeID))
|
||||
data.Set("paymentModeId", strconv.Itoa(bill.PaymentModeID))
|
||||
}
|
||||
if bill.CategoryID != 0 {
|
||||
data.Set("categoryid", strconv.Itoa(bill.CategoryID))
|
||||
data.Set("categoryId", strconv.Itoa(bill.CategoryID))
|
||||
}
|
||||
if bill.OriginalCurrencyID != 0 {
|
||||
data.Set("original_currency_id", strconv.Itoa(bill.OriginalCurrencyID))
|
||||
|
||||
@@ -283,11 +283,11 @@ func TestCreateBill(t *testing.T) {
|
||||
if r.FormValue("comment") != "" {
|
||||
t.Errorf("Comment should be empty: %s", r.FormValue("comment"))
|
||||
}
|
||||
if r.FormValue("paymentmodeid") != "" {
|
||||
t.Errorf("paymentmodeid should be empty: %s", r.FormValue("paymentmodeid"))
|
||||
if r.FormValue("paymentModeId") != "" {
|
||||
t.Errorf("paymentmodeid should be empty: %s", r.FormValue("paymentModeId"))
|
||||
}
|
||||
if r.FormValue("categoryid") != "" {
|
||||
t.Errorf("categoryid should be empty: %s", r.FormValue("categoryid"))
|
||||
if r.FormValue("categoryId") != "" {
|
||||
t.Errorf("categoryid should be empty: %s", r.FormValue("categoryId"))
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user