Sha256: be2ce597ceccb240a18fc1de5fb8c7e1286b5011cd2f24b117e086336c8682e1

Contents?: true

Size: 790 Bytes

Versions: 50

Compression:

Stored size: 790 Bytes

Contents

require 'spec_helper'

describe Bookmark do
  subject do
    b = Bookmark.new 
    b.user_id = 1
    b.document = SolrDocument.new(id: 'u001')
    b
  end
  
  it "should be valid" do
    expect(subject).to be_valid
  end

  it "should belong to user" do
    expect(Bookmark.reflect_on_association(:user)).not_to be_nil
  end

  it "should be valid after saving" do
    subject.save
    expect(subject).to be_valid
  end
  
  describe "#document_type" do
    it "should be the class of the solr document" do
      expect(subject.document_type).to eq SolrDocument
    end
  end
  
  describe "#document" do
    it "should be a SolrDocument with just an id field" do
      expect(subject.document).to be_a_kind_of SolrDocument
      expect(subject.document.id).to eq 'u001'
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/models/bookmark_spec.rb
blacklight-5.19.1 spec/models/bookmark_spec.rb
blacklight-5.19.0 spec/models/bookmark_spec.rb
blacklight-5.18.0 spec/models/bookmark_spec.rb
blacklight-5.17.2 spec/models/bookmark_spec.rb
blacklight-6.0.0.pre5 spec/models/bookmark_spec.rb
blacklight-5.17.1 spec/models/bookmark_spec.rb
blacklight-5.17.0 spec/models/bookmark_spec.rb
blacklight-6.0.0.pre4 spec/models/bookmark_spec.rb
blacklight-5.16.4 spec/models/bookmark_spec.rb
blacklight-6.0.0.pre3 spec/models/bookmark_spec.rb
blacklight-5.16.3 spec/models/bookmark_spec.rb
blacklight-5.16.2 spec/models/bookmark_spec.rb
blacklight-5.16.1 spec/models/bookmark_spec.rb
blacklight-6.0.0.pre2 spec/models/bookmark_spec.rb
blacklight-6.0.0.pre1 spec/models/bookmark_spec.rb
blacklight-5.16.0 spec/models/bookmark_spec.rb
blacklight-5.15.0 spec/models/bookmark_spec.rb
blacklight-5.14.0 spec/models/bookmark_spec.rb
blacklight-5.13.1 spec/models/bookmark_spec.rb