Sha256: cf3629d5f40655f1045f3d2cd9d86d761098ee7ff243a0983732aa6dfd64b788
Contents?: true
Size: 908 Bytes
Versions: 47
Compression:
Stored size: 908 Bytes
Contents
require 'spec_helper' describe Limit do subject { Factory(:limit) } it { should belong_to(:plan) } it { should validate_presence_of(:name) } it { should validate_presence_of(:value) } end describe Limit, "various kinds" do let!(:users) { Factory(:limit, :name => "users", :value => 1) } let!(:ssl) { Factory(:limit, :name => "ssl", :value => 0, :value_type => :boolean) } let!(:lighthouse) { Factory(:limit, :name => "lighthouse", :value => 1, :value_type => :boolean) } it "gives the numbered limits" do Limit.numbered.should == [users] end it "gives the boolean limits" do Limit.boolean.should == [ssl, lighthouse] end it "gives the limits by name" do Limit.named(:users).should == users end it "reports true for booleans with 1" do lighthouse.allowed?.should be end it "reports false for booleans with 0" do ssl.allowed?.should_not be end end
Version data entries
47 entries across 47 versions & 1 rubygems