def test_api_details
create(:message, :read, :recipient => users(:normal_user))
+ create(:message, :sender => users(:normal_user))
# check that nothing is returned when not logged in
get :api_details
# FIXME: needs changeset factory
changeset_id 3
- # FIXME: needs user factory
- author_id 1
+ association :author, :factory => :user
end
end
sequence(:body) { |n| "This is diary comment #{n}" }
diary_entry
-
- # Fixme requires User Factory
- user_id 1
+ user
end
end
sequence(:title) { |n| "Diary entry #{n}" }
sequence(:body) { |n| "This is diary entry #{n}" }
- # Fixme requires User Factory
- user_id 1
+ user
end
end
FactoryGirl.define do
factory :friend do
- # Fixme requires User Factory
- user_id 1
- friend_user_id 2
+ association :befriender, :factory => :user
+ association :befriendee, :factory => :user
end
end
sequence(:body) { |n| "Body text for message #{n}" }
sent_on Time.now
- # FIXME: needs user factory
- from_user_id 1
-
- # FIXME: needs user factory
- to_user_id 2
+ association :sender, :factory => :user
+ association :recipient, :factory => :user
trait :unread do
message_read false
sequence(:name) { |n| "Trace #{n}.gpx" }
sequence(:description) { |n| "This is trace #{n}" }
- # Fixme requires User Factory
- user_id 1
+ user
timestamp Time.now
inserted true
sequence(:reason) { |n| "User Block #{n}" }
ends_at Time.now + 1.day
- # FIXME: requires User factory
- user_id 13
-
- # FIXME: requires User factory
- creator_id 15
+ user
+ association :creator, :factory => :moderator_user
trait :needs_view do
needs_view true
sequence(:k) { |n| "Key #{n}" }
sequence(:v) { |n| "Value #{n}" }
- # FIXME: needs user factory
- user_id 1
+ user
end
end
def test_add_duplicate_preference
up = create(:user_preference)
new_up = UserPreference.new
- new_up.user = users(:normal_user)
+ new_up.user = up.user
new_up.k = up.k
new_up.v = "some other value"
assert_not_equal new_up.v, up.v