Sha256: 88a13c47ab254b026aac169bad6c59f9f010226fa7666cf59fed25f0d6e91b86

Contents?: true

Size: 1.82 KB

Versions: 3

Compression:

Stored size: 1.82 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
require "active_fedora"

describe GenericImage do
  
  before(:each) do
    Fedora::Repository.stubs(:instance).returns(stub_everything())
    @hydra_image = GenericImage.new

  end
  
  it "Should be a kind of ActiveFedora::Base" do
    @hydra_image.should be_kind_of(ActiveFedora::Base)
  end
  
  it "should include Hydra Model Methods" do
    @hydra_image.class.included_modules.should include(Hydra::ModelMethods)
    @hydra_image.should respond_to(:apply_depositor_metadata)
  end
  
  it "should have accessors for its default datastreams of content and original" do
    @hydra_image.should respond_to(:has_content?)
    @hydra_image.should respond_to(:content)
    @hydra_image.should respond_to(:content=)
    @hydra_image.should respond_to(:has_original?)
    @hydra_image.should respond_to(:original)
    @hydra_image.should respond_to(:original=)
  end
  
  it "should have accessors for its default datastreams of max, screen and thumbnail" do
    @hydra_image.should respond_to(:has_max?)
    @hydra_image.should respond_to(:max)
    @hydra_image.should respond_to(:max=)
    @hydra_image.should respond_to(:has_screen?)
    @hydra_image.should respond_to(:screen)
    @hydra_image.should respond_to(:screen=)
    @hydra_image.should respond_to(:has_thumbnail?)
    @hydra_image.should respond_to(:thumbnail)
    @hydra_image.should respond_to(:thumbnail=)
  end

  it "should create a max datastream when setting max value to image file" do
    f = File.new(File.join( File.dirname(__FILE__), "../../fixtures/image.jp2" ))
    @hydra_image.max = f
  end
  
  describe '#content=' do
    it "shoutld create a content datastream when given an image file" do
    end
  end

  describe '#derive_all' do
    it "should create a max, screen and thumbnail file" do 
    end
  end

  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hydra-head-3.0.0pre3 test_support/spec/models/generic_image_spec.rb
hydra-head-3.0.0pre2 test_support/spec/models/generic_image_spec.rb
hydra-head-3.0.0pre1 test_support/spec/models/generic_image_spec.rb