Sha256: d677d1a83fe625adb2a295ee71b17a5e67db4248f47864ddc73108052d39f767
Contents?: true
Size: 711 Bytes
Versions: 14
Compression:
Stored size: 711 Bytes
Contents
require 'spec_helper' describe "persisting objects" do before :all do class MockAFBaseRelationship < ActiveFedora::Base has_metadata :type=>ActiveFedora::SimpleDatastream, :name=>"foo" do |m| m.field "name", :string end Deprecation.silence(ActiveFedora::Attributes) do has_attributes :name, datastream: 'foo', multiple: false end validates :name, presence: true end end after :all do Object.send(:remove_const, :MockAFBaseRelationship) end describe "#create!" do it "should validate" do expect { MockAFBaseRelationship.create!}.to raise_error ActiveFedora::RecordInvalid, "Validation failed: Name can't be blank" end end end
Version data entries
14 entries across 14 versions & 1 rubygems