Sha256: 1b0391593afc6a4a7088248ece37c8272cc1185f4e8dbf5df6e4d1feaa97f87b

Contents?: true

Size: 627 Bytes

Versions: 6

Compression:

Stored size: 627 Bytes

Contents

require 'spec_helper'

describe Trophy, :type => :model do
   before(:all) do
    @trophy = Trophy.create(user_id:99,generic_file_id:"99")
  end

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

  it "should have a file" do
     expect(@trophy).to respond_to(:generic_file_id)
     expect(@trophy.generic_file_id).to eq("99")
  end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sufia-6.0.0 spec/models/trophy_spec.rb
sufia-6.0.0.rc4 spec/models/trophy_spec.rb
sufia-6.0.0.rc3 spec/models/trophy_spec.rb
sufia-6.0.0.rc2 spec/models/trophy_spec.rb
sufia-6.0.0.rc1 spec/models/trophy_spec.rb
sufia-6.0.0.beta1 spec/models/trophy_spec.rb