diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-22 15:33:06 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-22 15:33:06 +0100 |
commit | 39aa7132ceed3d4beab3a9b828e571bbfc67c07e (patch) | |
tree | 6c88289c9f99be0af8635636fcdf64102090e5ec /test/unit/phone_book_entry_test.rb | |
parent | 5ad8203ce4f1bfea997960d0b52c626dea24b944 (diff) | |
parent | 6f69c1a85055ec7c2515719d79d2a7a4e60cec50 (diff) |
Merge branch 'develop'5.1-beta1
Diffstat (limited to 'test/unit/phone_book_entry_test.rb')
-rw-r--r-- | test/unit/phone_book_entry_test.rb | 22 |
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 |