summaryrefslogtreecommitdiff
path: root/test/unit/user_group_test.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
commit39aa7132ceed3d4beab3a9b828e571bbfc67c07e (patch)
tree6c88289c9f99be0af8635636fcdf64102090e5ec /test/unit/user_group_test.rb
parent5ad8203ce4f1bfea997960d0b52c626dea24b944 (diff)
parent6f69c1a85055ec7c2515719d79d2a7a4e60cec50 (diff)
Merge branch 'develop'5.1-beta1
Diffstat (limited to 'test/unit/user_group_test.rb')
-rw-r--r--test/unit/user_group_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/user_group_test.rb b/test/unit/user_group_test.rb
index 5e815a8..1023bd6 100644
--- a/test/unit/user_group_test.rb
+++ b/test/unit/user_group_test.rb
@@ -2,23 +2,23 @@ require 'test_helper'
class UserGroupTest < ActiveSupport::TestCase
def test_should_have_a_valid_factory
- assert Factory.build(:user_group).valid?
+ assert FactoryGirl.build(:user_group).valid?
end
def test_should_have_unique_name_on_same_tenant
- tenant1 = Factory.create(:tenant)
- tenant2 = Factory.create(:tenant)
- group = Factory.create(:user_group, :tenant_id => tenant1.id)
- assert !Factory.build(:user_group, :name => group.name, :tenant_id => tenant1.id).valid?
- assert Factory.build(:user_group, :name => group.name, :tenant_id => tenant2.id).valid?
- assert Factory.build(:user_group, :name => "different_#{group.name}", :tenant_id => tenant1.id).valid?
+ tenant1 = FactoryGirl.create(:tenant)
+ tenant2 = FactoryGirl.create(:tenant)
+ group = FactoryGirl.create(:user_group, :tenant_id => tenant1.id)
+ assert !FactoryGirl.build(:user_group, :name => group.name, :tenant_id => tenant1.id).valid?
+ assert FactoryGirl.build(:user_group, :name => group.name, :tenant_id => tenant2.id).valid?
+ assert FactoryGirl.build(:user_group, :name => "different_#{group.name}", :tenant_id => tenant1.id).valid?
end
test "user_group_membership only available for tenant_memberships" do
- good_tenant = Factory.create(:tenant)
- evil_tenant = Factory.create(:tenant)
+ good_tenant = FactoryGirl.create(:tenant)
+ evil_tenant = FactoryGirl.create(:tenant)
- user = Factory.create(:user)
+ user = FactoryGirl.create(:user)
good_tenant.tenant_memberships.create(:user_id => user.id)
good_user_group = good_tenant.user_groups.create(:name => 'Example')