Sha256: 46f576bd8de7c821c20f389dcb403dc6b5aa84098466566f2df1dddcad681119

Contents?: true

Size: 1.3 KB

Versions: 6

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe GenericFile do
  before do
    subject.apply_depositor_metadata('jcoyne')
  end

  describe "terms_for_editing" do
    it "should return a list" do
      subject.terms_for_editing.should == [:resource_type, :title, :creator, :contributor, :description, :tag, 
                    :rights, :publisher, :date_created, :subject, :language, :identifier, :based_near, :related_url]
    end
  end
  describe "terms_for_display" do
    it "should return a list" do
      expect(subject.terms_for_display).to eq([:resource_type, :title, 
        :creator, :contributor, :description, :tag, :rights, :publisher,
        :date_created, :date_uploaded, :date_modified, :subject, :language,
        :identifier, :based_near, :related_url])
    end
  end

  describe "accessible_attributes" do
    it "should have a list" do
      subject.accessible_attributes.should == [:part_of, :resource_type, :title, :creator, :contributor, :description, 
        :tag, :rights, :publisher, :date_created, :date_uploaded, :date_modified, :subject, :language, :identifier, 
        :based_near, :related_url, :permissions]
    end

    it "should sanitize them" do
      subject.sanitize_attributes({'part_of' => 'A book', 'something_crazy' => "get's thrown out"}).should ==
        {'part_of' => 'A book'}
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sufia-3.7.2 spec/models/generic_file/web_form_spec.rb
sufia-3.7.1 spec/models/generic_file/web_form_spec.rb
sufia-3.7.0 spec/models/generic_file/web_form_spec.rb
sufia-3.6.1 spec/models/generic_file/web_form_spec.rb
sufia-3.6.0 spec/models/generic_file/web_form_spec.rb
sufia-3.5.0 spec/models/generic_file/web_form_spec.rb