require 'spec_helper'

describe JoinRequestSerializer do
  it 'works' do
    user = create :user
    list = create :list
    join_request = list.join_request_for_user(user)
    JoinRequestSerializer.new(join_request).as_json.deep_symbolize_keys.should =~ {
      users: [UserUserSerializer.new(user).as_json(root: false)],
      join_request: {
        id: "jr-#{user.id}",
        created_at: nil,
        updated_at: nil,
        list_id: list.id,
        user_id: user.id
      }
    }
  end
end
