Added some model tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
25
spec/models/benchmark_model_spec.rb
Normal file
25
spec/models/benchmark_model_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative '../spec_helper'
|
||||
|
||||
RSpec.describe(Benchmark) do
|
||||
describe 'Benchmark Creation' do
|
||||
it 'Benchmark creation updates model count.' do
|
||||
expect{ Benchmark.create(name: 'Test Benchmark', scoring: 'fps') }.to(change { Benchmark.count }.by(1))
|
||||
end
|
||||
end
|
||||
|
||||
describe 'Benchmark Read' do
|
||||
before { Benchmark.create(name: 'Test Benchmark', scoring: 'fps') }
|
||||
|
||||
it 'Benchmark model has name.' do
|
||||
bench = Benchmark.first()
|
||||
expect(bench.name).to(eq('Test Benchmark'))
|
||||
end
|
||||
|
||||
it 'Benchmark model has scoring.' do
|
||||
bench = Benchmark.first()
|
||||
expect(bench.scoring).to(eq('fps'))
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user