Commit 2b70516

mokha <mokha@cisco.com>
2018-03-06 22:05:46
add spec for AuthnRequest.
1 parent 1aa8285
Changed files (1)
spec
saml
kit
cli
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