Sha256: 78873d5a23cfc7a1d83962169b644d9e9a029442d750f8f06cd8f8d2a8a7638b

Contents?: true

Size: 707 Bytes

Versions: 11

Compression:

Stored size: 707 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Bookmark do
  before(:each) do
    @bookmark = Bookmark.new
  end
  
  it "should be valid" do
    @bookmark.id = 1
    @bookmark.user_id = 1
    @bookmark.document_id = 'u001'
    expect(@bookmark).to be_valid
  end
   
  it "should require user_id" do
    expect(@bookmark).to have(1).error_on(:user_id)
  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
    @bookmark.id = 1
    @bookmark.user_id = 1
    @bookmark.document_id = 'u001'
    @bookmark.save
    expect(@bookmark).to be_valid
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blacklight-5.3.0 spec/models/bookmark_spec.rb
blacklight-5.0.3 spec/models/bookmark_spec.rb
blacklight-5.1.1 spec/models/bookmark_spec.rb
blacklight-5.2.0 spec/models/bookmark_spec.rb
blacklight-5.1.0 spec/models/bookmark_spec.rb
blacklight-5.0.2 spec/models/bookmark_spec.rb
blacklight-5.0.1 spec/models/bookmark_spec.rb
blacklight-5.0.0 spec/models/bookmark_spec.rb
blacklight-5.0.0.pre4 spec/models/bookmark_spec.rb
blacklight-5.0.0.pre3 spec/models/bookmark_spec.rb
blacklight-5.0.0.pre2 spec/models/bookmark_spec.rb