Sha256: c59dd9ab6d977f433ab34674268883b294893ace144e71d9caffacf8e86789b7

Contents?: true

Size: 775 Bytes

Versions: 6

Compression:

Stored size: 775 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

6 entries across 6 versions & 1 rubygems

Version Path
xmlenc-0.1.5 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.4 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.3 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.2 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.1 spec/lib/xmlenc/builder/encryption_method_spec.rb
xmlenc-0.1.0 spec/lib/xmlenc/builder/encryption_method_spec.rb