# frozen_string_literal: true

require_relative '../spec_helper'

RSpec.describe(Benchmark) do
  describe 'Benchmark Creation' do
    it 'Benchmark creation updates model count.' do
      expect do
        described_class.create(name: 'Test Benchmark', scoring: 'fps')
      end.to(change(described_class, :count).by(1))
    end
  end

  describe 'Benchmark Read' do
    before { described_class.create(name: 'Test Benchmark', scoring: 'fps') }

    it 'Benchmark model has name.' do
      bench = described_class.first()
      expect(bench.name).to(eq('Test Benchmark'))
    end

    it 'Benchmark model has scoring.' do
      bench = described_class.first()
      expect(bench.scoring).to(eq('fps'))
    end
  end
end
