require "rails_helper"

module AudioConfirmations
  RSpec.describe AudioConfirmationsPresenter do
    describe "#present" do
      describe "audio_confirmations" do
        it "returns audio_confirmations sorted by appears_at" do
          audio_confirmations = [
            build(:audio_confirmation, time_elapsed: 0),
            build(:audio_confirmation, time_elapsed: 50),
            build(:audio_confirmation, time_elapsed: 10),
          ]

          results = subject.present(audio_confirmations).audio_confirmations

          expect(results.map(&:appears_at)).to eq ["00:00:00:00", "00:00:10:00", "00:00:50:00"]
        end
      end
    end
  end
end
