Sha256: a66e7f32c66c2fe8da498012d9568b51705838a1c408b2d8b27610b1f8146093

Contents?: true

Size: 860 Bytes

Versions: 41

Compression:

Stored size: 860 Bytes

Contents

require 'spec_helper'

describe ActiveFedora::Base do
  describe "active model methods" do
    class BarHistory < ActiveFedora::Base
      property :fubar, predicate: ::RDF::URI('http://example.com/fubar'), multiple: false
      property :duck, predicate: ::RDF::URI('http://example.com/duck'), multiple: false
    end
    subject(:history) { BarHistory.new }

    describe "attributes=" do
      it "sets attributes" do
        history.attributes = { fubar: "baz", duck: "Quack" }
        expect(history.fubar).to eq "baz"
        expect(history.duck).to eq "Quack"
      end
    end

    describe "update_attributes" do
      it "sets attributes and save" do
        history.update_attributes(fubar: "baz", duck: "Quack")
        history.reload
        expect(history.fubar).to eq "baz"
        expect(history.duck).to eq "Quack"
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
active-fedora-12.2.4 spec/unit/base_active_model_spec.rb
active-fedora-12.2.3 spec/unit/base_active_model_spec.rb
active-fedora-11.5.6 spec/unit/base_active_model_spec.rb
active-fedora-12.2.2 spec/unit/base_active_model_spec.rb
active-fedora-11.2.1 spec/unit/base_active_model_spec.rb
active-fedora-12.2.1 spec/unit/base_active_model_spec.rb
active-fedora-12.0.3 spec/unit/base_active_model_spec.rb
active-fedora-11.5.5 spec/unit/base_active_model_spec.rb
active-fedora-13.1.2 spec/unit/base_active_model_spec.rb
active-fedora-13.1.1 spec/unit/base_active_model_spec.rb
active-fedora-13.1.0 spec/unit/base_active_model_spec.rb
active-fedora-13.0.0 spec/unit/base_active_model_spec.rb
active-fedora-12.1.1 spec/unit/base_active_model_spec.rb
active-fedora-12.1.0 spec/unit/base_active_model_spec.rb
active-fedora-11.5.4 spec/unit/base_active_model_spec.rb
active-fedora-11.5.3 spec/unit/base_active_model_spec.rb
active-fedora-12.0.2 spec/unit/base_active_model_spec.rb
active-fedora-12.0.1 spec/unit/base_active_model_spec.rb
active-fedora-11.5.2 spec/unit/base_active_model_spec.rb
active-fedora-12.0.0 spec/unit/base_active_model_spec.rb