From 2c3400fb4f5a22951d42f286975201bf817d7883 Mon Sep 17 00:00:00 2001 From: floppydiskette Date: Fri, 13 Sep 2024 12:58:12 +0100 Subject: wrong --- spec/requests/api/me/show_spec.cr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 spec/requests/api/me/show_spec.cr (limited to 'spec/requests/api/me/show_spec.cr') diff --git a/spec/requests/api/me/show_spec.cr b/spec/requests/api/me/show_spec.cr new file mode 100644 index 0000000..0e1f91f --- /dev/null +++ b/spec/requests/api/me/show_spec.cr @@ -0,0 +1,17 @@ +require "../../../spec_helper" + +describe Api::Me::Show do + it "returns the signed in user" do + user = UserFactory.create + + response = ApiClient.auth(user).exec(Api::Me::Show) + + response.should send_json(200, email: user.email) + end + + it "fails if not authenticated" do + response = ApiClient.exec(Api::Me::Show) + + response.status_code.should eq(401) + end +end -- cgit v1.2.3-54-g00ecf