summaryrefslogtreecommitdiff
path: root/test/unit/user_group_membership_test.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:03:10 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:03:10 +0100
commit4e716cea253be9293b247fbe74d25fe288b7853f (patch)
treee7d5ba33b69dfcfbc910d157ca65591a8f022c5b /test/unit/user_group_membership_test.rb
parentcac008f58299c443557867588288d7c954026dd2 (diff)
Converted Factory to FactoryGirl.
Diffstat (limited to 'test/unit/user_group_membership_test.rb')
-rw-r--r--test/unit/user_group_membership_test.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/unit/user_group_membership_test.rb b/test/unit/user_group_membership_test.rb
index 251229f..34a577c 100644
--- a/test/unit/user_group_membership_test.rb
+++ b/test/unit/user_group_membership_test.rb
@@ -2,29 +2,29 @@ require 'test_helper'
class UserGroupMembershipTest < ActiveSupport::TestCase
def test_should_have_a_valid_factory
- assert Factory.build(:user_group_membership).valid?
+ assert FactoryGirl.build(:user_group_membership).valid?
end
def test_should_have_unique_members_in_each_group
- group1 = Factory.create(:user_group)
- group2 = Factory.create(:user_group)
- user1 = Factory.create(:user)
- user2 = Factory.create(:user)
- member = Factory.create(
+ group1 = FactoryGirl.create(:user_group)
+ group2 = FactoryGirl.create(:user_group)
+ user1 = FactoryGirl.create(:user)
+ user2 = FactoryGirl.create(:user)
+ member = FactoryGirl.create(
:user_group_membership,
:user_id => user1.id,
:user_group_id => group1.id
)
- assert !Factory.build(
+ assert !FactoryGirl.build(
:user_group_membership,
:user_id => user1.id,
:user_group_id => group1.id
).valid?
- assert Factory.build(
+ assert FactoryGirl.build(
:user_group_membership,
:user_id => user1.id,
:user_group_id => group2.id
).valid?
- assert Factory.build(
+ assert FactoryGirl.build(
:user_group_membership,
:user_id => user2.id,
:user_group_id => group1.id
@@ -32,7 +32,7 @@ class UserGroupMembershipTest < ActiveSupport::TestCase
end
def test_that_the_initial_state_should_be_active
- @user_group_membership = Factory.create(:user_group_membership)
+ @user_group_membership = FactoryGirl.create(:user_group_membership)
assert_equal 'active', @user_group_membership.state
assert @user_group_membership.active?
end