Sha256: 33e2855f422e68def91089427e6b93d8efdf9604239dbd494ad048ac7c05fcbe
Contents?: true
Size: 857 Bytes
Versions: 22
Compression:
Stored size: 857 Bytes
Contents
require 'spec_helper' describe "delegating attributes" do before :all do class TitledObject < ActiveFedora::Base has_metadata 'foo', type: ActiveFedora::SimpleDatastream do |m| m.field "title", :string end has_attributes :title, datastream: 'foo', multiple: false end end after :all do Object.send(:remove_const, :TitledObject) end describe "save" do subject do obj = TitledObject.create obj.title = "Hydra for Dummies" obj.save obj end it "should keep a list of changes after a successful save" do expect(subject.previous_changes).to_not be_empty expect(subject.previous_changes.keys).to include("title") end it "should clean out changes" do expect(subject).to_not be_title_changed expect(subject.changes).to be_empty end end end
Version data entries
22 entries across 22 versions & 1 rubygems