Commit 2b70516
Changed files (1)
spec
saml
kit
cli
commands
spec/saml/kit/cli/commands/decode_spec.rb
@@ -22,6 +22,16 @@ RSpec.describe Saml::Kit::Cli::Commands::Decode do
Saml::Kit::Bindings::HttpPost.new(location: 'https://www.example.com/')
end
+ context "when the document is an AuthnRequest" do
+ let(:command) { "decode post #{post_binding.serialize(builder)[1]['SAMLRequest']}" }
+ let(:builder) { Saml::Kit::AuthenticationRequest.builder }
+ let(:document) { builder.build }
+
+ specify { expect(status).to be_success }
+ specify { expect(output).to include(document.to_xml(pretty: true)) }
+ specify { expect(output).to include("Decoded #{document.send(:name)}") }
+ end
+
context "when the document is a Response" do
let(:command) { "decode post #{post_binding.serialize(builder)[1]['SAMLResponse']}" }
let(:builder) do