Sha256: 26167a7f49b788a2323f6aa868090e13c05eef0cecba735f968119ea77adf82b

Contents?: true

Size: 850 Bytes

Versions: 13

Compression:

Stored size: 850 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 { BarHistory.new }

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

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
active-fedora-10.3.0 spec/unit/base_active_model_spec.rb
active-fedora-10.3.0.rc2 spec/unit/base_active_model_spec.rb
active-fedora-10.3.0.rc1 spec/unit/base_active_model_spec.rb
active-fedora-10.2.1 spec/unit/base_active_model_spec.rb
active-fedora-10.2.0 spec/unit/base_active_model_spec.rb
active-fedora-11.0.0.rc1 spec/unit/base_active_model_spec.rb
active-fedora-10.1.0 spec/unit/base_active_model_spec.rb
active-fedora-10.1.0.rc1 spec/unit/base_active_model_spec.rb
active-fedora-10.0.0 spec/unit/base_active_model_spec.rb
active-fedora-10.0.0.beta4 spec/unit/base_active_model_spec.rb
active-fedora-10.0.0.beta3 spec/unit/base_active_model_spec.rb
active-fedora-10.0.0.beta2 spec/unit/base_active_model_spec.rb
active-fedora-10.0.0.beta1 spec/unit/base_active_model_spec.rb