Sha256: 97d5a0756b0354a5d0771e1d522b49b042f6d7189fa08ea65d20c97dfc4d521b
Contents?: true
Size: 1.16 KB
Versions: 2
Compression:
Stored size: 1.16 KB
Contents
require 'spec_helper' module IiifPrint RSpec.describe DerivativeAttachment, type: :model do it "requires some columns to be considered complete" do model = described_class.create # attempt save without required data; expect failure expect { model.save! }.to raise_exception(ActiveRecord::RecordInvalid) end it "saves when constructed with all field values" do model = described_class.create( fileset_id: 'a1b2c3d4e5', path: '/path/to/somefile', destination_name: 'txt' ) # attempt save without required data; expect failure expect { model.save! }.not_to raise_exception end it "saves when all fields completely set" do model = described_class.create model.fileset_id = 'someid123' model.path = '/path/to/somefile' model.destination_name = 'txt' expect { model.save! }.not_to raise_exception end it "saves when only path, destination_name set" do model = described_class.create model.fileset_id = nil model.path = '/path/to/somefile' model.destination_name = 'txt' expect { model.save! }.not_to raise_exception end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
iiif_print-1.1.0 | spec/models/iiif_print/derivative_attachment_spec.rb |
iiif_print-1.0.0 | spec/models/iiif_print/derivative_attachment_spec.rb |