summaryrefslogtreecommitdiff
path: root/test/unit/phone_book_entry_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/phone_book_entry_test.rb')
-rw-r--r--test/unit/phone_book_entry_test.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/unit/phone_book_entry_test.rb b/test/unit/phone_book_entry_test.rb
index c8d639b..2613398 100644
--- a/test/unit/phone_book_entry_test.rb
+++ b/test/unit/phone_book_entry_test.rb
@@ -2,17 +2,17 @@ require 'test_helper'
class PhoneBookEntryTest < ActiveSupport::TestCase
def test_should_be_valid
- assert Factory.build(:phone_book_entry).valid?
+ assert FactoryGirl.build(:phone_book_entry).valid?
end
# TODO Fix this test.
# test "only user can read entries in private phone books" do
- # user = Factory.create(:user)
- # phone_book = Factory.create(:phone_book, :phone_bookable_type => 'User', :phone_bookable_id => user.id)
- # phone_book_entry = Factory.create(:phone_book_entry, :phone_book_id => phone_book.id)
+ # user = FactoryGirl.create(:user)
+ # phone_book = FactoryGirl.create(:phone_book, :phone_bookable_type => 'User', :phone_bookable_id => user.id)
+ # phone_book_entry = FactoryGirl.create(:phone_book_entry, :phone_book_id => phone_book.id)
- # evil_user = Factory.create(:user)
+ # evil_user = FactoryGirl.create(:user)
# user_ability = Ability.new( user )
# evil_user_ability = Ability.new( evil_user )
@@ -24,17 +24,17 @@ class PhoneBookEntryTest < ActiveSupport::TestCase
# end
def test_that_the_initial_state_should_be_active
- @phone_book_entry = Factory.create(:phone_book_entry)
+ @phone_book_entry = FactoryGirl.create(:phone_book_entry)
assert_equal 'active', @phone_book_entry.state
assert @phone_book_entry.active?
end
test "a destroyed phone_book will destroy all phone_book_entries" do
- phone_book = Factory.create(:phone_book)
- 10.times { Factory.create(:phone_book_entry, :phone_book_id => phone_book.id) }
+ phone_book = FactoryGirl.create(:phone_book)
+ 10.times { FactoryGirl.create(:phone_book_entry, :phone_book_id => phone_book.id) }
- phone_book2 = Factory.create(:phone_book)
- 5.times { Factory.create(:phone_book_entry, :phone_book_id => phone_book2.id) }
+ phone_book2 = FactoryGirl.create(:phone_book)
+ 5.times { FactoryGirl.create(:phone_book_entry, :phone_book_id => phone_book2.id) }
assert_equal 15, PhoneBookEntry.all.count
@@ -44,7 +44,7 @@ class PhoneBookEntryTest < ActiveSupport::TestCase
end
test "that the value_of_to_s field is filled" do
- phone_book_entry = Factory.create(:phone_book_entry)
+ phone_book_entry = FactoryGirl.create(:phone_book_entry)
assert_equal phone_book_entry.value_of_to_s, phone_book_entry.to_s
end