Sha256: f2c896ed6d30840ecd5706a94a40d9c7894ffbf8dc53fc968c2888848d8c49eb

Contents?: true

Size: 856 Bytes

Versions: 44

Compression:

Stored size: 856 Bytes

Contents

require File.join( File.dirname(__FILE__),  "../spec_helper" )

require 'active_resource'
require 'fedora/repository'

describe Fedora::Connection do
  it "should be creatable w/ a surrogate id" do
    c = Fedora::Connection.new('http://127.0.0.1/fedora', 'fubar', 'bob')
    c.site.to_s.should == "http://127.0.0.1/fedora"
    c.format.should == 'fubar'
    c.surrogate.should == 'bob'
  end
  it "should set a from header if surrogate defined." do
    c = Fedora::Connection.new('http://127.0.0.1/fedora', ActiveResource::Formats[:xml], 'bob')
    h = Hash.new
    r= c.send(:build_request_headers,h)
    r['From'].should == 'bob'
  end
  it "should not set a from header if surrogate undefined." do
    c = Fedora::Connection.new('http://127.0.0.1/fedora' )
    h = Hash.new
    r= c.send(:build_request_headers,h)
    r['From'].should be_nil
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
active-fedora-3.0.7 spec/unit/connection_spec.rb
active-fedora-3.0.6 spec/unit/connection_spec.rb
active-fedora-3.0.5 spec/unit/connection_spec.rb
active-fedora-3.0.4 spec/unit/connection_spec.rb
active-fedora-3.0.3 spec/unit/connection_spec.rb
active-fedora-3.0.1 spec/unit/connection_spec.rb
active-fedora-3.0.0 spec/unit/connection_spec.rb
active-fedora-2.3.7 spec/unit/connection_spec.rb
active-fedora-2.3.4 spec/unit/connection_spec.rb
active-fedora-2.3.3 spec/unit/connection_spec.rb
active-fedora-2.3.1 spec/unit/connection_spec.rb
active-fedora-2.3.0 spec/unit/connection_spec.rb
active-fedora-2.2.3 spec/unit/connection_spec.rb
active-fedora-2.2.2 spec/unit/connection_spec.rb
active-fedora-2.2.1 spec/unit/connection_spec.rb
active-fedora-2.2.0 spec/unit/connection_spec.rb
active-fedora-2.1.0 spec/unit/connection_spec.rb
active-fedora-2.0.4 spec/unit/connection_spec.rb
active-fedora-2.0.3 spec/unit/connection_spec.rb
active-fedora-2.0.2 spec/unit/connection_spec.rb