Sha256: cd3733f28628f963cf119a8cc4d846b27d2dadb837e75f5a110a4aa6f21b1876

Contents?: true

Size: 931 Bytes

Versions: 14

Compression:

Stored size: 931 Bytes

Contents

require "spec_helper"

describe Xmlenc::Builder::RetrievalMethod do

  it 'has a tag' do
    expect(described_class.tag_name).to eq 'RetrievalMethod'
  end

  it 'has a namespace' do
    expect(described_class.namespace).to eq 'ds'
  end

  describe "optional fields" do
    subject { described_class.new }

    [:type, :uri].each do |field|
      it "should have the #{field} field" do
        expect(subject).to respond_to field
      end

      it "should allow #{field} to be blank" do
        subject.send("#{field}=", nil)
        expect(subject).to be_valid
      end
    end
  end

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

    it 'should parse' do
      expect(subject).to be_a described_class
    end

    it 'should parse the URI' do
      expect(subject.uri).to eq '#_EK'
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
xmlenc-0.8.0 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.7.1 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.7.0 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.9 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.8 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.6 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.5 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.4 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.3 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.2 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.1 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.6.0 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.5.0 spec/lib/xmlenc/builder/retrieval_method_spec.rb
xmlenc-0.4.1 spec/lib/xmlenc/builder/retrieval_method_spec.rb