]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/user_controller_test.rb
Replace user_blocks fixture with a factory.
[rails.git] / test / controllers / user_controller_test.rb
index ede841032ef20072514bde568a1f1220f62b228d..c3a1116054edd014a31e37a4febc84d1ad9b1633 100644 (file)
@@ -2,7 +2,7 @@ require "test_helper"
 
 class UserControllerTest < ActionController::TestCase
   api_fixtures
-  fixtures :messages, :friends
+  fixtures :messages
 
   ##
   # test all routes which lead to this controller
@@ -924,6 +924,7 @@ class UserControllerTest < ActionController::TestCase
     end
 
     # Test a user who has been blocked
+    create(:user_block, :user => users(:blocked_user))
     get :view, :display_name => "blocked"
     assert_response :success
     assert_select "div#userinformation" do
@@ -938,6 +939,7 @@ class UserControllerTest < ActionController::TestCase
     end
 
     # Test a moderator who has applied blocks
+    create(:user_block, :creator => users(:moderator_user))
     get :view, :display_name => "moderator"
     assert_response :success
     assert_select "div#userinformation" do
@@ -1191,6 +1193,7 @@ class UserControllerTest < ActionController::TestCase
     # Get users to work with
     user = users(:normal_user)
     friend = users(:public_user)
+    create(:friend, :user_id => user.id, :friend_user_id => friend.id)
 
     # Check that the users are friends
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first
@@ -1231,6 +1234,7 @@ class UserControllerTest < ActionController::TestCase
     # Get users to work with
     user = users(:normal_user)
     friend = users(:public_user)
+    create(:friend, :user_id => user.id, :friend_user_id => friend.id)
 
     # Check that the users are friends
     assert Friend.where(:user_id => user.id, :friend_user_id => friend.id).first