Sha256: 8feba7fdda865b1e27cce6c9541602320ef10550a7f583bc3c63ede9151f3ae6

Contents?: true

Size: 565 Bytes

Versions: 23

Compression:

Stored size: 565 Bytes

Contents

describe Trophy, type: :model do
  let(:trophy) { described_class.create(user_id: 99, work_id: "99") }

  it "has a user" do
    expect(trophy).to respond_to(:user_id)
    expect(trophy.user_id).to eq(99)
  end

  it "has a work" do
    expect(trophy).to respond_to(:work_id)
    expect(trophy.work_id).to eq("99")
  end

  it "does not allow six trophies" do
    (1..6).each { |n| described_class.create(user_id: 120, work_id: n.to_s) }
    expect(described_class.where(user_id: 120).count).to eq(5)
    described_class.where(user_id: 120).map(&:delete)
  end
end

Version data entries

23 entries across 23 versions & 3 rubygems

Version Path
hyrax-1.1.1 spec/models/trophy_spec.rb
hyrax-1.1.0 spec/models/trophy_spec.rb
sufia-7.4.1 spec/models/trophy_spec.rb
hyrax-1.0.5 spec/models/trophy_spec.rb
sufia-7.4.0 spec/models/trophy_spec.rb
hyrax-1.0.4 spec/models/trophy_spec.rb
hyrax-1.0.3 spec/models/trophy_spec.rb
hyrax-1.0.2 spec/models/trophy_spec.rb
hyrax-1.0.1 spec/models/trophy_spec.rb
hyrax-1.0.0.rc2 spec/models/trophy_spec.rb
sufia-7.3.1 spec/models/trophy_spec.rb
hyrax-1.0.0.rc1 spec/models/trophy_spec.rb
sufia-7.3.0 spec/models/trophy_spec.rb
sufia-7.3.0.rc3 spec/models/trophy_spec.rb
sufia-7.3.0.rc2 spec/models/trophy_spec.rb
sufia-7.3.0.rc1 spec/models/trophy_spec.rb
test_hyrax-0.0.1.alpha spec/models/trophy_spec.rb
sufia-7.2.0 spec/models/trophy_spec.rb
sufia-7.1.0 spec/models/trophy_spec.rb
sufia-7.0.0 spec/models/trophy_spec.rb