Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 31 lines (23 sloc) 0.85 kb
02fd5de Matt Jankowski change to use rspec
mjankowski authored
1 require 'spec_helper'
2
3 describe 'Boolean' do
4
5 before do
a619187 Matt Jankowski avoid factory girl syntax deprecation warnings
mjankowski authored
6 @one = create :user, :admin => true
7 @two = create :user, :admin => true
8 @three = create :user, :admin => true
9 @four = create :user, :admin => false
10 @five = create :user, :admin => false
02fd5de Matt Jankowski change to use rspec
mjankowski authored
11 end
12
13 it "should set the correct expected values for a boolean column method" do
14 User.admin.should == [@one, @two, @three]
15 end
16
17 it "should set the correct expected values for a not_ boolean column method" do
18 User.not_admin.should == [@four, @five]
19 end
20
21 it "should return correct value for balance class method when true greater than false" do
22 User.admin_balance.should == 1
23 end
24
25 it "should return correct value for balance class method when true less than false" do
a619187 Matt Jankowski avoid factory girl syntax deprecation warnings
mjankowski authored
26 3.times { create :user, :admin => false }
02fd5de Matt Jankowski change to use rspec
mjankowski authored
27 User.admin_balance.should == -2
28 end
29
30 end
Something went wrong with that request. Please try again.