[Issue #16] - Finished updating Test controller routes that used to reference Benchmarks
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Gregory Ballantine
2025-10-09 15:43:53 -04:00
parent b19c95187b
commit 2884b94b7f
7 changed files with 24 additions and 17 deletions

View File

@@ -59,10 +59,11 @@ RSpec.describe(TestController) do
before do
@hardware = Hardware.create(name: 'Test Hardware', type: 'gpu')
@benchmark = Benchmark.create(name: 'Test Benchmark', scoring: 'fps')
@benchmark_profile = BenchmarkProfile.create(label: 'Test Benchmark Profile', settings: '{}', benchmark_id: @benchmark.id)
request_data = {
test_name: 'Test Test',
test_hardware: @hardware.id,
'test_benchmarks[]': [@benchmark.id],
'test_benchmarks[]': [@benchmark_profile.id],
test_description: 'Test for testing'
}
post '/test/add', request_data
@@ -93,11 +94,11 @@ RSpec.describe(TestController) do
end
it 'Test add POST route created test has benchmarks.' do
expect(Test.first.benchmarks.length).to(eq(1))
expect(Test.first.benchmark_profiles.length).to(eq(1))
end
it 'Test add POST route created test\'s benchmark can be read.' do
expect(Test.first.benchmarks[0].id).to(eq(@benchmark.id))
expect(Test.first.benchmark_profiles[0].id).to(eq(@benchmark.id))
end
it 'Test add POST route created test has description.' do
@@ -110,12 +111,13 @@ RSpec.describe(TestController) do
before do
@hardware = Hardware.create(name: 'Test Hardware', type: 'gpu')
@benchmark = Benchmark.create(name: 'Test Benchmark', scoring: 'fps')
@benchmark_profile = BenchmarkProfile.create(label: 'Test Benchmark Profile', settings: '{}', benchmark_id: @benchmark.id)
@test = Test.create(
name: 'Test Test',
hardware_id: @hardware.id,
description: 'Test for testing'
)
@test.add_benchmark(@benchmark)
@test.add_benchmark_profile(@benchmark_profile)
get "/test/#{@test.id}"
end
@@ -141,12 +143,13 @@ RSpec.describe(TestController) do
before do
@hardware = Hardware.create(name: 'Test Hardware', type: 'gpu')
@benchmark = Benchmark.create(name: 'Test Benchmark', scoring: 'fps')
@benchmark_profile = BenchmarkProfile.create(label: 'Test Benchmark Profile', settings: '{}', benchmark_id: @benchmark.id)
@test = Test.create(
name: 'Test Test',
hardware_id: @hardware.id,
description: 'Test for testing'
)
@test.add_benchmark(@benchmark)
@test.add_benchmark_profile(@benchmark_profile)
get "/test/#{@test.id}/edit"
end