factories are defined for user and post. user_id field is added to Post model. Relationship is created between user and post. RSpec tests are added for user-post relationship.