require 'spec_helper' module SamlIdp describe ResponseBuilder do let(:response_id) { "abc" } let(:issuer_uri) { "http://example.com" } let(:saml_acs_url) { "http://sportngin.com" } let(:saml_request_id) { "134" } let(:assertion_and_signature) { "http://sportngin.comstuffjon.phenow@sportngin.comhttp://example.comjon.phenow@sportngin.comurn:federation:authentication:windows" } subject { described_class.new( response_id, issuer_uri, saml_acs_url, saml_request_id, assertion_and_signature ) } before do Timecop.freeze(Time.local(1990)) end after do Timecop.return end it "builds a legit raw XML file" do Timecop.travel(Time.zone.local(2010, 6, 1, 13, 0, 0)) do subject.raw.should == "http://example.comhttp://sportngin.comstuffjon.phenow@sportngin.comhttp://example.comjon.phenow@sportngin.comurn:federation:authentication:windows" end end end end