-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
(ns apossiblespace.parts.account | ||
(:require | ||
[com.brunobonacci.mulog :as mulog])) | ||
|
||
(defn get-account | ||
"Retrieve own account info" | ||
[] | ||
{:success "GET account"}) | ||
|
||
(defn update-account | ||
"Update own account info" | ||
[account-data] | ||
{:success "PUT account"}) | ||
|
||
(defn delete-account | ||
"Delete own account" | ||
[confirm] | ||
{:success "DELETE account"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
(ns apossiblespace.account-test | ||
(:require [clojure.test :refer [deftest is testing use-fixtures]] | ||
[apossiblespace.test-helpers :refer [with-test-db]] | ||
[apossiblespace.test-factory :as factory])) | ||
|
||
(use-fixtures :once with-test-db) | ||
|
||
;; TODO: Use register-test-user from the helpers | ||
(deftest test-get-account | ||
(testing "disallows access without a valid token") | ||
(testing "allows access with a valid token") | ||
(testing "returns correct user information")) | ||
|
||
(deftest test-update-account | ||
(testing "disallows access without a valid token") | ||
(testing "allows access with a valid token") | ||
(testing "correctly updates the user data") | ||
(testing "returns updated user information")) | ||
|
||
(deftest delete-account | ||
(testing "disallows access without a valid token") | ||
(testing "allows access with a valid token") | ||
(testing "does not delete account without confirmation param") | ||
(testing "deletes account with confirmation param")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters