Sha256: abeb9d9d0ce2dfa761f5ea1d5055fc743c1998858f4fd66c9e6cc36ec2a3c3b5
Contents?: true
Size: 1.33 KB
Versions: 13
Compression:
Stored size: 1.33 KB
Contents
require 'spec_helper' module Kosher describe Seller do before do @seller = Seller.new end describe "#blacklist" do it "defaults to an empty array" do @seller.blacklist.should eql [] end end describe "#blacklisted?" do before do Seller.blacklist = ['foo'] end it "returns true if the seller is blacklisted" do @seller.id = 'foo' @seller.should be_blacklisted end it "returns false if the seller is not blacklisted" do @seller.id = 'bar' @seller.should_not be_blacklisted end end describe "#kosher?" do before do Seller.threshold = 4.8 end it "returns true if rating is 0.0" do @seller.rating = 0.0 @seller.should be_kosher end it "returns true if rating is nil" do @seller.should be_kosher end it "returns true if rating is within threshold" do @seller.rating = 4.8 @seller.should be_kosher end it "returns false if rating is not within threshold" do @seller.rating = 4.7 @seller.should_not be_kosher end it "returns false if seller is blacklisted" do @seller.id = ['foo'] Seller.blacklist = [@seller.id] @seller.should_not be_kosher end end end end
Version data entries
13 entries across 13 versions & 1 rubygems