Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alxlion committed Jul 11, 2024
1 parent 3817539 commit b39ab64
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions test/lti_13/jwks_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
10 changes: 8 additions & 2 deletions test/lti_13/resources_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
}

Expand Down

0 comments on commit b39ab64

Please sign in to comment.