# typed: false
require "rails_helper"

RSpec.describe Domain::Post::InkbunnyPost, type: :model do
  it "has a valid factory" do
    expect(build(:domain_post_inkbunny_post)).to be_valid
  end

  it "can include pools" do
    post = create(:domain_post_inkbunny_post)
    pool = post.pools.create!(ib_id: 1, name: "Test Pool")

    found_post =
      Domain::Post::InkbunnyPost.includes(:pools).find_by(ib_id: post.ib_id)

    expect(found_post).to eq(post)
    expect(found_post.pools).to eq([pool])
  end
end
