Created
November 6, 2014 14:37
-
-
Save Ch4s3/08b882cf85b3c994631d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe User do | |
it { should validate_presence_of(:password) } | |
it { should belong_to :organization } | |
it { should ensure_inclusion_of(:type).in_array(User.descendants.map(&:name)) } | |
describe "factory" do | |
subject { FactoryGirl.build :user } | |
before { FactoryGirl.create :user } | |
it { should be_valid } | |
end | |
describe "doctor" do | |
subject { FactoryGirl.build :doctor } | |
before { FactoryGirl.create :doctor } | |
it { should be_valid } | |
end | |
describe "admin" do | |
subject { FactoryGirl.build :admin_user } | |
before { FactoryGirl.create :admin_user } | |
it { should be_valid } | |
end | |
describe "root" do | |
subject { FactoryGirl.build :root_user } | |
before { FactoryGirl.create :root_user } | |
it { should be_valid } | |
end | |
describe "#root" do | |
subject { described_class.new.root? } | |
it { should be_false } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment