From b39ab64663dfcf148123f40bfa2bb12b8e4c1ca5 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 11 Jul 2024 17:06:54 +0200 Subject: [PATCH] Fix tests --- test/lti_13/jwks_test.exs | 9 +++++++++ test/lti_13/resources_test.exs | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/test/lti_13/jwks_test.exs b/test/lti_13/jwks_test.exs index b4bff32f..9b23e080 100644 --- a/test/lti_13/jwks_test.exs +++ b/test/lti_13/jwks_test.exs @@ -23,6 +23,15 @@ defmodule Lti13.JwksTest do end test "create and get all jwks" do + {:ok, _} = + Lti13.Jwks.create_jwk(%{ + pem: Lti13.Jwks.Utils.KeyGenerator.generate_key_pair().private_key, + typ: "JWT", + alg: "RS256", + kid: UUID.uuid4(), + active: true + }) + active_jwk = Lti13.Jwks.get_active_jwk() %{private_key: private_key} = Lti13.Jwks.Utils.KeyGenerator.generate_key_pair() diff --git a/test/lti_13/resources_test.exs b/test/lti_13/resources_test.exs index b958df0b..bf5e96ab 100644 --- a/test/lti_13/resources_test.exs +++ b/test/lti_13/resources_test.exs @@ -69,8 +69,11 @@ defmodule Lti13.ResourcesTest do test "create_resource_with_event/1 with valid attributes and lti_user", %{ registration: registration } do + {:ok, user} = + Claper.Accounts.create_user(%{email: "test@example.com", password: "password123"}) + lti_user = %Lti13.Users.User{ - user_id: 1, + user_id: user.id, registration_id: registration.id } @@ -90,8 +93,11 @@ defmodule Lti13.ResourcesTest do end test "create_resource_with_event/1 with invalid attributes", %{registration: registration} do + {:ok, user} = + Claper.Accounts.create_user(%{email: "test@example.com", password: "password123"}) + lti_user = %Lti13.Users.User{ - user_id: 1, + user_id: user.id, registration_id: registration.id }