assert users(:normal_user).is_friends_with?(users(:public_user))
assert !users(:normal_user).is_friends_with?(users(:inactive_user))
assert !users(:public_user).is_friends_with?(users(:normal_user))
assert users(:normal_user).is_friends_with?(users(:public_user))
assert !users(:normal_user).is_friends_with?(users(:inactive_user))
assert !users(:public_user).is_friends_with?(users(:normal_user))
- # friend = Friend.new
- # friend.befriender = norm
- # friend.befriendee = sec
- # friend.save
+ create(:friend, :befriender => norm, :befriendee => sec)
+ assert_equal 1, Friend.count
assert_equal [sec], norm.friend_users
assert_equal 1, norm.friend_users.size
assert_equal 1, Friend.count
assert_equal [sec], norm.friend_users
assert_equal 1, norm.friend_users.size
assert_equal 1, Friend.count
+ create(:language, :code => "en")
+ create(:language, :code => "de")
+ create(:language, :code => "sl")
+
user = users(:normal_user)
assert_equal ["en"], user.languages
user.languages = %w(de fr en)
assert_equal %w(de fr en), user.languages
user.languages = %w(fr de sl)
assert_equal "de", user.preferred_language
user = users(:normal_user)
assert_equal ["en"], user.languages
user.languages = %w(de fr en)
assert_equal %w(de fr en), user.languages
user.languages = %w(fr de sl)
assert_equal "de", user.preferred_language
user = users(:public_user)
assert_equal %w(en de), user.languages
end
user = users(:public_user)
assert_equal %w(en de), user.languages
end