diff options
Diffstat (limited to 'spec/support/api_client.cr')
-rw-r--r-- | spec/support/api_client.cr | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/api_client.cr b/spec/support/api_client.cr new file mode 100644 index 0000000..46d449a --- /dev/null +++ b/spec/support/api_client.cr @@ -0,0 +1,12 @@ +class ApiClient < Lucky::BaseHTTPClient + app AppServer.new + + def initialize + super + headers("Content-Type": "application/json") + end + + def self.auth(user : User) + new.headers("Authorization": UserToken.generate(user)) + end +end |