Sha256: 2f8117c1dfc521768df5dbe01e3fbef234e117567f8674c9fdb10e23b9d325aa

Contents?: true

Size: 628 Bytes

Versions: 36

Compression:

Stored size: 628 Bytes

Contents

require 'spec_helper'

describe Trophy do
   before(:all) do
    @trophy = Trophy.create(user_id:99,generic_file_id:"99")
  end
  after(:all) do
    @trophy.delete
  end

  it "should have a user" do
     @trophy.should respond_to(:user_id)
     @trophy.user_id.should == 99
  end
  it "should have a file" do
     @trophy.should respond_to(:generic_file_id)
     @trophy.generic_file_id.should == "99"
  end

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

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
sufia-4.0.1 spec/models/trophy_spec.rb
sufia-4.0.0 spec/models/trophy_spec.rb
sufia-4.0.0.rc2 spec/models/trophy_spec.rb
sufia-4.0.0.rc1 spec/models/trophy_spec.rb
sufia-4.0.0.beta4 spec/models/trophy_spec.rb
sufia-4.0.0.beta3 spec/models/trophy_spec.rb
sufia-4.0.0.beta2 spec/models/trophy_spec.rb
sufia-4.0.0.beta1 spec/models/trophy_spec.rb
sufia-3.7.2 spec/models/trophy_spec.rb
sufia-3.7.1 spec/models/trophy_spec.rb
sufia-3.7.0 spec/models/trophy_spec.rb
sufia-3.6.1 spec/models/trophy_spec.rb
sufia-3.6.0 spec/models/trophy_spec.rb
sufia-3.5.0 spec/models/trophy_spec.rb
sufia-3.4.0 spec/models/trophy_spec.rb
sufia-3.4.0.rc4 spec/models/trophy_spec.rb
sufia-3.4.0.rc3 spec/models/trophy_spec.rb
sufia-3.3.1 spec/models/trophy_spec.rb
sufia-3.4.0.rc2 spec/models/trophy_spec.rb
sufia-3.4.0.rc1 spec/models/trophy_spec.rb