Skip to content

Commit

Permalink
I wonder if Github CI will be happy with this one
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryape committed Aug 5, 2024
1 parent b103c9d commit dca7603
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 10 deletions.
16 changes: 12 additions & 4 deletions test/smee/smee_entity_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,21 @@ defmodule SmeeEntityTest do
end

describe "Protocol String.Chars.to_string/1" do
assert "#[Entity https://indiid.net/idp/shibboleth]" = "#{@idp_entity}"

test "Entity is interpolated into a string in the correct format" do
assert "#[Entity https://indiid.net/idp/shibboleth]" = "#{@idp_entity}"
end
end

describe "Protocol Jason Encoder" do
assert "{\"compressed\":false,\"data\":\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"" <> _ = Jason.encode!(
@idp_entity
)

test "entity is stored in a suitable JSON format" do
encoded_and_decoded = Jason.encode!(@idp_entity)
|> Jason.decode!()

assert is_map(encoded_and_decoded)

end
end

describe "registration_authority/1" do
Expand Down
13 changes: 11 additions & 2 deletions test/smee/smee_metadata_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -878,11 +878,20 @@ defmodule SmeeMetadataTest do
end

describe "Protocol String.Chars.to_string/1" do
"#[Metadata file:test/support/static/aggregate.xml]" = "#{@valid_metadata}"

test "Metadata is converted into a suitable string" do
"#[Metadata file:test/support/static/aggregate.xml]" = "#{@valid_metadata}"
end

end

describe "Protocol Jason Encoder" do
"{\"compressed\":false,\"data\":\"" <> _ = Jason.encode!(@valid_metadata)

test "Metadata is serialised as JSON" do
encoded_and_decoded = Jason.encode!(@valid_metadata)
|> Jason.decode!
assert is_map(encoded_and_decoded)
end
end

end
18 changes: 14 additions & 4 deletions test/smee/smee_source_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,23 @@ defmodule SmeeSourceTest do
end

describe "Protocol String.Chars.to_string/1" do
source = Source.new("http://metadata.ukfederation.org.uk/ukfederation-metadata.xml")
"#[Source http://metadata.ukfederation.org.uk/ukfederation-metadata.xml]" = "#{source}"

test "Source is converted into a suitable string" do
source = Source.new("http://metadata.ukfederation.org.uk/ukfederation-metadata.xml")
"#[Source http://metadata.ukfederation.org.uk/ukfederation-metadata.xml]" = "#{source}"
end
end

describe "Protocol Jason Encoder" do
source = Source.new("http://metadata.ukfederation.org.uk/ukfederation-metadata.xml")
"{\"id\":null,\"label\":null,\"priority\":5,\"type\":\"aggregate\"" <> _ = Jason.encode!(source)

test "Source is serialised into JSON" do

source = Source.new("http://metadata.ukfederation.org.uk/ukfederation-metadata.xml")
encoded_and_decoded = Jason.encode!(source)
|> Jason.decode!
assert is_map(encoded_and_decoded)

end
end

end

0 comments on commit dca7603

Please sign in to comment.