Adds user.verified_organization?

This commit is contained in:
kikito
2015-08-18 17:24:31 +02:00
committed by Juanjo Bazán
parent 04db8112b4
commit 21c2fa2e3d
2 changed files with 23 additions and 0 deletions

View File

@@ -125,6 +125,25 @@ describe User do
end
end
describe "verified_organization?" do
it "is falsy when the user is not an organization" do
expect(subject).to_not be_verified_organization
end
describe 'when it is an organization' do
before(:each) { create(:organization, user: subject) }
it "is false when the user is not a verified organization" do
expect(subject).to_not be_verified_organization
end
it "is true when the user is a verified organization" do
subject.organization.verify
expect(subject).to be_verified_organization
end
end
end
describe "organization_attributes" do
before(:each) { subject.organization_attributes = {name: 'org'} }