Sha256: 8b624bf8de4f7cc9cc008a94ca8221772f538569d10a0501fb26161f88891daf

Contents?: true

Size: 831 Bytes

Versions: 36

Compression:

Stored size: 831 Bytes

Contents

# frozen_string_literal: true

describe Bookmark do
  let(:user) { User.create! email: 'xyz@example.com', password: 'xyz12345'}
  subject do
    b = Bookmark.new(user: user)
    b.document = SolrDocument.new(id: 'u001')
    b
  end

  it "is valid" do
    expect(subject).to be_valid
  end

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

  it "is valid after saving" do
    subject.save
    expect(subject).to be_valid
  end
  
  describe "#document_type" do
    it "is the class of the solr document" do
      expect(subject.document_type).to eq SolrDocument
    end
  end
  
  describe "#document" do
    it "is 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

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/models/bookmark_spec.rb
blacklight-6.24.0 spec/models/bookmark_spec.rb
blacklight-6.23.0 spec/models/bookmark_spec.rb
blacklight-6.22.0 spec/models/bookmark_spec.rb
blacklight-6.21.0 spec/models/bookmark_spec.rb
blacklight-6.20.0 spec/models/bookmark_spec.rb
blacklight-6.19.2 spec/models/bookmark_spec.rb
blacklight-6.19.1 spec/models/bookmark_spec.rb
blacklight-6.19.0 spec/models/bookmark_spec.rb
blacklight-6.18.0 spec/models/bookmark_spec.rb
blacklight-6.17.0 spec/models/bookmark_spec.rb
blacklight-6.16.0 spec/models/bookmark_spec.rb
blacklight-6.15.0 spec/models/bookmark_spec.rb
blacklight-6.14.1 spec/models/bookmark_spec.rb
blacklight-6.14.0 spec/models/bookmark_spec.rb
blacklight-6.13.0 spec/models/bookmark_spec.rb
blacklight-6.12.0 spec/models/bookmark_spec.rb
blacklight-6.11.2 spec/models/bookmark_spec.rb
blacklight-6.11.1 spec/models/bookmark_spec.rb
blacklight-6.11.0 spec/models/bookmark_spec.rb