Sha256: 9eb397a279595f44c399d9b72cf09537479a9c485259935c5b7aaadef5b6df8c

Contents?: true

Size: 778 Bytes

Versions: 4

Compression:

Stored size: 778 Bytes

Contents

require "spec_helper"

describe Xmlenc::Builder::EncryptionMethod do

  let(:xml) { File.read File.join("spec", "fixtures", "encrypted_document.xml") }
  subject   { described_class.parse(xml, :single => true) }

  describe "required fields" do
    it "should have the algorithm field" do
      expect(subject).to respond_to :algorithm
    end

    it "should check the presence of algorithm" do
      subject.algorithm = nil
      expect(subject).to have(1).error_on :algorithm
    end
  end

  describe "#parse" do
    it "should create an EncryptionMethod" do
      expect(subject).to be_a Xmlenc::Builder::EncryptionMethod
    end

    it "should parse the algorithm" do
      expect(subject.algorithm).to eq "http://www.w3.org/2001/04/xmlenc#aes128-cbc"
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xmlenc-0.2.1 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.2.0 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.7 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.6 spec/lib/xmlenc/builder/encryption_method_spec.rb