Sha256: fd51196f9e14937cb1d09820d47374a45532b8c8dec726220c4c7bfe7f07688e

Contents?: true

Size: 849 Bytes

Versions: 90

Compression:

Stored size: 849 Bytes

Contents

# frozen_string_literal: true

RSpec.describe Bookmark do
  subject do
    b = described_class.new(user: user)
    b.document = SolrDocument.new(id: 'u001')
    b
  end

  let(:user) { User.create! email: 'xyz@example.com', password: 'xyz12345' }

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

  it "belongs to user" do
    expect(described_class.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

90 entries across 89 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/models/bookmark_spec.rb
blacklight-7.39.0 spec/models/bookmark_spec.rb
blacklight-7.38.0 spec/models/bookmark_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/models/bookmark_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/models/bookmark_spec.rb
blacklight-8.3.0 spec/models/bookmark_spec.rb
blacklight-8.2.2 spec/models/bookmark_spec.rb
blacklight-8.2.1 spec/models/bookmark_spec.rb
blacklight-8.2.0 spec/models/bookmark_spec.rb
blacklight-7.37.0 spec/models/bookmark_spec.rb
blacklight-7.36.2 spec/models/bookmark_spec.rb
blacklight-7.36.1 spec/models/bookmark_spec.rb
blacklight-7.36.0 spec/models/bookmark_spec.rb
blacklight-7.35.0 spec/models/bookmark_spec.rb
blacklight-8.1.0 spec/models/bookmark_spec.rb
blacklight-7.34.0 spec/models/bookmark_spec.rb
blacklight-8.0.1 spec/models/bookmark_spec.rb
blacklight-8.0.0 spec/models/bookmark_spec.rb
blacklight-8.0.0.beta8 spec/models/bookmark_spec.rb
blacklight-8.0.0.beta7 spec/models/bookmark_spec.rb