Compare commits
11 Commits
v0.2.1
...
2884b94b7f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2884b94b7f | ||
|
|
b19c95187b | ||
| a736113abd | |||
| 9c9b038ef8 | |||
| 85749a4616 | |||
| 619c122769 | |||
| 8c5f510c70 | |||
| 8b2c152803 | |||
| 98717db3d5 | |||
| 5d249eb3c7 | |||
| 4ed915a2c0 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -63,8 +63,7 @@ data/
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
# Compiled assets
|
# Compiled assets
|
||||||
public/css/
|
public/*/
|
||||||
public/js/
|
|
||||||
|
|
||||||
# Ignore production configuration files to protect against credential leaks
|
# Ignore production configuration files to protect against credential leaks
|
||||||
config/production.yaml
|
config/production.yaml
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ steps:
|
|||||||
- gem install rake
|
- gem install rake
|
||||||
- bundle config set --local path "vendor/bundle"
|
- bundle config set --local path "vendor/bundle"
|
||||||
- bundle install
|
- bundle install
|
||||||
- rake db:migrate
|
- RACK_ENV=testing rake db:migrate
|
||||||
|
|
||||||
test_ruby34:
|
test_ruby34:
|
||||||
image: ruby:3.4
|
image: ruby:3.4
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# Game Data
|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
# Game Data
|
||||||
|
|
||||||
Web-based tool to store and organize PC hardware gaming benchmarks.
|
Web-based tool to store and organize PC hardware gaming benchmarks.
|
||||||
|
|
||||||
## Project Goals
|
## Project Goals
|
||||||
|
|||||||
BIN
assets/img/app-logo.png
Normal file
BIN
assets/img/app-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
assets/img/favicon.png
Normal file
BIN
assets/img/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1008 KiB |
@@ -1,7 +1,34 @@
|
|||||||
$ ->
|
$ ->
|
||||||
# run foundation scripts
|
# let us know when javascript is running.
|
||||||
console.log('Ready.')
|
console.log('Ready.')
|
||||||
|
|
||||||
|
lastColumn = null
|
||||||
|
ascending = true
|
||||||
|
|
||||||
|
tableHeaders = $('th')
|
||||||
|
tableHeaders.click (e) ->
|
||||||
|
column = $(this).index()
|
||||||
|
table = $(this).closest('table')
|
||||||
|
|
||||||
|
if column is lastColumn
|
||||||
|
ascending = not ascending
|
||||||
|
else
|
||||||
|
ascending = true
|
||||||
|
|
||||||
|
lastColumn = column
|
||||||
|
sortTable(table, column, ascending)
|
||||||
|
|
||||||
|
sortTable = (table, column, ascending) ->
|
||||||
|
rows = table.find('tbody tr').get()
|
||||||
|
|
||||||
|
compareFunction = (a, b) ->
|
||||||
|
res = a.cells[column].textContent.localeCompare b.cells[column].textContent
|
||||||
|
if ascending then res else -res
|
||||||
|
|
||||||
|
rows.sort compareFunction
|
||||||
|
$(rows).detach().appendTo(table.find('tbody'))
|
||||||
|
return
|
||||||
|
|
||||||
averageResults = (results, decimals = 2) ->
|
averageResults = (results, decimals = 2) ->
|
||||||
avgScore = 0
|
avgScore = 0
|
||||||
minScore = Infinity
|
minScore = Infinity
|
||||||
|
|||||||
@@ -14,8 +14,20 @@ body
|
|||||||
table
|
table
|
||||||
border: 1px solid #666
|
border: 1px solid #666
|
||||||
|
|
||||||
|
a
|
||||||
|
transition: color 220ms ease-in-out
|
||||||
|
|
||||||
#wrapper
|
#wrapper
|
||||||
background: white
|
background: white
|
||||||
padding: 1.5rem 2rem
|
padding: 1.5rem 2rem
|
||||||
border: 1px solid #bbb
|
border: 1px solid #bbb
|
||||||
border-radius: 8px
|
border-radius: 8px
|
||||||
|
|
||||||
|
#main-nav
|
||||||
|
li
|
||||||
|
a
|
||||||
|
font-size: 1.25rem
|
||||||
|
|
||||||
|
#site-title
|
||||||
|
img
|
||||||
|
max-height: 40px
|
||||||
|
|||||||
97
db/migrations/0004_add_benchmarksettings_table.rb
Normal file
97
db/migrations/0004_add_benchmarksettings_table.rb
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
Sequel.migration do
|
||||||
|
up do
|
||||||
|
# 1. Create benchmark_profiles
|
||||||
|
create_table(:benchmark_profiles) do
|
||||||
|
primary_key :id
|
||||||
|
String :label, null: false
|
||||||
|
String :settings, null: false
|
||||||
|
foreign_key :benchmark_id, :benchmarks, null: false, on_delete: :cascade
|
||||||
|
DateTime :created_at, default: Sequel::CURRENT_TIMESTAMP
|
||||||
|
DateTime :updated_at, default: Sequel::CURRENT_TIMESTAMP
|
||||||
|
end
|
||||||
|
|
||||||
|
# 2. Create join table (tests <-> benchmark_profiles)
|
||||||
|
create_table(:benchmark_profiles_tests) do
|
||||||
|
primary_key :id
|
||||||
|
foreign_key :test_id, :tests, null: false, on_delete: :cascade
|
||||||
|
foreign_key :benchmark_profile_id, :benchmark_profiles, null: false, on_delete: :cascade
|
||||||
|
|
||||||
|
index [:test_id, :benchmark_profile_id], unique: true
|
||||||
|
end
|
||||||
|
|
||||||
|
# 3. Add benchmark_profile_id to results
|
||||||
|
alter_table(:results) do
|
||||||
|
add_foreign_key :benchmark_profile_id, :benchmark_profiles, null: true, on_delete: :cascade
|
||||||
|
end
|
||||||
|
|
||||||
|
# 4. Migrate data from old schema
|
||||||
|
from(:benchmarks).each do |b_row|
|
||||||
|
# Create a BenchmarkProfile for this (test, benchmark) pair
|
||||||
|
bp_id = self[:benchmark_profiles].insert(
|
||||||
|
benchmark_id: b_row[:id],
|
||||||
|
label: 'Default',
|
||||||
|
settings: '{}'
|
||||||
|
)
|
||||||
|
|
||||||
|
from(:benchmarks_tests).each do |bt_row|
|
||||||
|
if bt_row[:benchmark_id] == b_row[:id]
|
||||||
|
# Link it to the test
|
||||||
|
self[:benchmark_profiles_tests].insert(
|
||||||
|
test_id: bt_row[:test_id],
|
||||||
|
benchmark_profile_id: bp_id
|
||||||
|
)
|
||||||
|
|
||||||
|
# Update results belonging to this test + benchmark pair
|
||||||
|
self[:results]
|
||||||
|
.where(test_id: bt_row[:test_id], benchmark_id: bt_row[:benchmark_id])
|
||||||
|
.update(benchmark_profile_id: bp_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# 5. Clean up old schema
|
||||||
|
alter_table(:results) do
|
||||||
|
drop_foreign_key :benchmark_id
|
||||||
|
end
|
||||||
|
|
||||||
|
drop_table(:benchmarks_tests)
|
||||||
|
end
|
||||||
|
|
||||||
|
down do
|
||||||
|
# 1. Recreate old join table
|
||||||
|
create_table(:benchmarks_tests) do
|
||||||
|
foreign_key :test_id, :tests, null: false
|
||||||
|
foreign_key :benchmark_id, :benchmarks, null: false
|
||||||
|
end
|
||||||
|
|
||||||
|
# 2. Add benchmark_id back to results
|
||||||
|
alter_table(:results) do
|
||||||
|
add_foreign_key :benchmark_id, :benchmarks, null: true
|
||||||
|
end
|
||||||
|
|
||||||
|
# 3. Restore data
|
||||||
|
from(:benchmark_profiles_tests).each do |bpt_row|
|
||||||
|
bp = self[:benchmark_profiles][id: bpt_row[:benchmark_profile_id]]
|
||||||
|
next unless bp # safety check
|
||||||
|
|
||||||
|
# Recreate old benchmarks_tests entry
|
||||||
|
self[:benchmarks_tests].insert(
|
||||||
|
test_id: bpt_row[:test_id],
|
||||||
|
benchmark_id: bp[:benchmark_id]
|
||||||
|
)
|
||||||
|
|
||||||
|
# Update results to point back to benchmark_id
|
||||||
|
self[:results]
|
||||||
|
.where(test_id: bpt_row[:test_id], benchmark_profile_id: bp[:id])
|
||||||
|
.update(benchmark_id: bp[:benchmark_id])
|
||||||
|
end
|
||||||
|
|
||||||
|
# 4. Remove new schema
|
||||||
|
alter_table(:results) do
|
||||||
|
drop_foreign_key :benchmark_profile_id
|
||||||
|
end
|
||||||
|
|
||||||
|
drop_table(:benchmark_profiles_tests)
|
||||||
|
drop_table(:benchmark_profiles)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -20,16 +20,23 @@ function compileCoffee() {
|
|||||||
.pipe(gulp.dest('public/js', { sourcemaps: '.' }));
|
.pipe(gulp.dest('public/js', { sourcemaps: '.' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy image files to public/img/
|
||||||
|
function copyImages() {
|
||||||
|
return gulp.src('assets/img/**/*', {encoding: false})
|
||||||
|
.pipe(gulp.dest('public/img/'));
|
||||||
|
}
|
||||||
|
|
||||||
// Watch files for changes
|
// Watch files for changes
|
||||||
function watchFiles(cb) {
|
function watchFiles(cb) {
|
||||||
gulp.watch('assets/styles/**/*.sass', compileSass);
|
gulp.watch('assets/styles/**/*.sass', compileSass);
|
||||||
gulp.watch('assets/scripts/**/*.coffee', compileCoffee);
|
gulp.watch('assets/scripts/**/*.coffee', compileCoffee);
|
||||||
|
gulp.watch('assets/img/**/*', copyImages)
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Chain all asset builds together
|
// Chain all asset builds together
|
||||||
function buildAssets() {
|
function buildAssets() {
|
||||||
return gulp.parallel(compileSass, compileCoffee);
|
return gulp.parallel(compileSass, compileCoffee, copyImages);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform initial build then watch
|
// Perform initial build then watch
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../spec_helper'
|
require_relative '../spec_helper'
|
||||||
|
require_relative '../../src/models/benchmark'
|
||||||
|
|
||||||
RSpec.describe(BenchmarkController) do
|
RSpec.describe(BenchmarkController) do
|
||||||
# /benchmark - redirects to /benchmark/list
|
# GET /benchmark - redirects to /benchmark/list
|
||||||
describe 'GET /benchmark' do
|
describe 'GET /benchmark' do
|
||||||
before { get '/benchmark' }
|
before { get '/benchmark' }
|
||||||
|
|
||||||
it 'Benchmark base route is a redirect' do
|
it 'Benchmark base route is a redirect.' do
|
||||||
expect(last_response).to(be_redirect)
|
expect(last_response).to(be_redirect)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Benchmark base route is an HTML response.' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it 'Benchmark base route Location header points to /benchmark/list' do
|
it 'Benchmark base route Location header points to /benchmark/list' do
|
||||||
expect(last_response['Location']).to(eq("#{BASE_URL}/benchmark/list"))
|
expect(last_response['Location']).to(eq("#{BASE_URL}/benchmark/list"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /benchmark/list - displays a table of benchmarks
|
# GET /benchmark/list - displays a table of benchmarks
|
||||||
describe 'GET /benchmark/list' do
|
describe 'GET /benchmark/list' do
|
||||||
before { get '/benchmark/list' }
|
before { get '/benchmark/list' }
|
||||||
|
|
||||||
@@ -24,12 +29,16 @@ RSpec.describe(BenchmarkController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Benchmark list page is an HTML response.' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Benchmark list page contains 'List of benchmarks' on page." do
|
it "Benchmark list page contains 'List of benchmarks' on page." do
|
||||||
expect(last_response.body).to(include('List of benchmarks'))
|
expect(last_response.body).to(include('List of benchmarks'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /benchmark/add - form for adding benchmark
|
# GET /benchmark/add - form for adding benchmark
|
||||||
describe 'GET /benchmark/add' do
|
describe 'GET /benchmark/add' do
|
||||||
before { get '/benchmark/add' }
|
before { get '/benchmark/add' }
|
||||||
|
|
||||||
@@ -37,8 +46,92 @@ RSpec.describe(BenchmarkController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add page is an HTML response.' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Benchmark add page contains 'Add new benchmark' on page." do
|
it "Benchmark add page contains 'Add new benchmark' on page." do
|
||||||
expect(last_response.body).to(include('Add new benchmark'))
|
expect(last_response.body).to(include('Add new benchmark'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST /benchmark/add - backend for adding a benchmark
|
||||||
|
describe 'POST /benchmark/add' do
|
||||||
|
before do
|
||||||
|
request_data = {
|
||||||
|
benchmark_name: 'Test Benchmark',
|
||||||
|
benchmark_scoring: 'fps',
|
||||||
|
benchmark_description: 'Benchmark for testing'
|
||||||
|
}
|
||||||
|
post '/benchmark/add', request_data
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route is a redirect.' do
|
||||||
|
expect(last_response).to(be_redirect)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route is an HTML response.' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route Location header points to /benchmark/1' do
|
||||||
|
expect(last_response['Location']).to(eq("#{BASE_URL}/benchmark/1"))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route creates new Benchmark.' do
|
||||||
|
expect(Benchmark.count).to(eq(1))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route created benchmark has name.' do
|
||||||
|
expect(Benchmark.first.name).to(eq('Test Benchmark'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route created benchmark has scoring type.' do
|
||||||
|
expect(Benchmark.first.scoring).to(eq('fps'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark add POST route created benchmark has description.' do
|
||||||
|
expect(Benchmark.first.description).to(eq('Benchmark for testing'))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /benchmark/:benchmark_id - page for viewing a benchmark model
|
||||||
|
describe 'GET /benchmark/:benchmark_id' do
|
||||||
|
before do
|
||||||
|
@benchmark = Benchmark.create(name: 'Test Benchmark', scoring: 'fps')
|
||||||
|
get "/benchmark/#{@benchmark.id}"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark view page returns 200.' do
|
||||||
|
expect(last_response).to(be_ok)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark view page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark view page contains "Add new benchmark" on page.' do
|
||||||
|
expect(last_response.body).to(include("#{@benchmark.name}"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /benchmark/:benchmark_id/edit - page for editing a benchmark model
|
||||||
|
describe 'GET /benchmark/:benchmark_id/edit' do
|
||||||
|
before do
|
||||||
|
@benchmark = Benchmark.create(name: 'Test Benchmark', scoring: 'fps')
|
||||||
|
get "/benchmark/#{@benchmark.id}/edit"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark edit page returns 200.' do
|
||||||
|
expect(last_response).to(be_ok)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark edit page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Benchmark edit page contains "Editing: <benchmark name>" on page.' do
|
||||||
|
expect(last_response.body).to(include("Editing: #{@benchmark.name}"))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require_relative '../spec_helper'
|
require_relative '../spec_helper'
|
||||||
|
require_relative '../../src/models/hardware'
|
||||||
|
|
||||||
RSpec.describe(HardwareController) do
|
RSpec.describe(HardwareController) do
|
||||||
# /hardware - redirects to /hardware/list
|
# GET /hardware - redirects to /hardware/list
|
||||||
describe 'GET /hardware' do
|
describe 'GET /hardware' do
|
||||||
before { get '/hardware' }
|
before { get '/hardware' }
|
||||||
|
|
||||||
@@ -11,12 +12,16 @@ RSpec.describe(HardwareController) do
|
|||||||
expect(last_response).to(be_redirect)
|
expect(last_response).to(be_redirect)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Hardware base route is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it 'Hardware base route Location header points to /hardware/list' do
|
it 'Hardware base route Location header points to /hardware/list' do
|
||||||
expect(last_response['Location']).to(eq("#{BASE_URL}/hardware/list"))
|
expect(last_response['Location']).to(eq("#{BASE_URL}/hardware/list"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /hardware/list - displays a table of hardwares
|
# GET /hardware/list - displays a table of hardwares
|
||||||
describe 'GET /hardware/list' do
|
describe 'GET /hardware/list' do
|
||||||
before { get '/hardware/list' }
|
before { get '/hardware/list' }
|
||||||
|
|
||||||
@@ -24,12 +29,16 @@ RSpec.describe(HardwareController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Hardware list page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Hardware list page contains 'List of hardware' on page." do
|
it "Hardware list page contains 'List of hardware' on page." do
|
||||||
expect(last_response.body).to(include('List of hardware'))
|
expect(last_response.body).to(include('List of hardware'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /hardware/add - form for adding hardware
|
# GET /hardware/add - form for adding hardware
|
||||||
describe 'GET /hardware/add' do
|
describe 'GET /hardware/add' do
|
||||||
before { get '/hardware/add' }
|
before { get '/hardware/add' }
|
||||||
|
|
||||||
@@ -37,8 +46,87 @@ RSpec.describe(HardwareController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Hardware add page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Hardware add page contains 'Add new hardware' on page." do
|
it "Hardware add page contains 'Add new hardware' on page." do
|
||||||
expect(last_response.body).to(include('Add new hardware'))
|
expect(last_response.body).to(include('Add new hardware'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST /hardware/add - backend for adding a hardware component
|
||||||
|
describe 'POST /hardware/add' do
|
||||||
|
before do
|
||||||
|
request_data = {
|
||||||
|
hardware_name: 'Test Hardware',
|
||||||
|
hardware_type: 'gpu'
|
||||||
|
}
|
||||||
|
post '/hardware/add', request_data
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware add POST route is a redirect.' do
|
||||||
|
expect(last_response).to(be_redirect)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware add POST route is an HTML response.' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware add POST route Location header points to /hardware/1' do
|
||||||
|
expect(last_response['Location']).to(eq("#{BASE_URL}/hardware/1"))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware add POST route creates new Hardware.' do
|
||||||
|
expect(Hardware.count).to(eq(1))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware add POST route created hardware has name.' do
|
||||||
|
expect(Hardware.first.name).to(eq('Test Hardware'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware add POST route created hardware has type.' do
|
||||||
|
expect(Hardware.first.type).to(eq('gpu'))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /hardware/:hardware_id - page for viewing a hardware model
|
||||||
|
describe 'GET /hardware/:hardware_id' do
|
||||||
|
before do
|
||||||
|
@hardware = Hardware.create(name: 'Test Hardware', type: 'gpu')
|
||||||
|
get "/hardware/#{@hardware.id}"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware view page returns 200.' do
|
||||||
|
expect(last_response).to(be_ok)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware view page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware view page contains "Add new hardware" on page.' do
|
||||||
|
expect(last_response.body).to(include("#{@hardware.name}"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /hardware/:hardware_id/edit - page for editing a hardware model
|
||||||
|
describe 'GET /hardware/:hardware_id/edit' do
|
||||||
|
before do
|
||||||
|
@hardware = Hardware.create(name: 'Test Hardware', type: 'gpu')
|
||||||
|
get "/hardware/#{@hardware.id}/edit"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware edit page returns 200.' do
|
||||||
|
expect(last_response).to(be_ok)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware edit page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Hardware edit page contains "Editing: <hardware name>" on page.' do
|
||||||
|
expect(last_response.body).to(include("Editing: #{@hardware.name}"))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ RSpec.describe(IndexController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Dashboard is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Dashboard contains 'Game Data' on page (nav bar should be loaded)." do
|
it "Dashboard contains 'Game Data' on page (nav bar should be loaded)." do
|
||||||
expect(last_response.body).to(include('Game Data'))
|
expect(last_response.body).to(include('Game Data'))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ RSpec.describe(ReportsController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "Reports page contains 'Generate report' on page." do
|
it 'Reports page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Reports page contains "Generate report" on page.' do
|
||||||
expect(last_response.body).to(include('Generate report'))
|
expect(last_response.body).to(include('Generate report'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
require_relative '../spec_helper'
|
require_relative '../spec_helper'
|
||||||
|
|
||||||
RSpec.describe(TestController) do
|
RSpec.describe(TestController) do
|
||||||
# /test - redirects to /test/list
|
# GET /test - redirects to /test/list
|
||||||
describe 'GET /test' do
|
describe 'GET /test' do
|
||||||
before { get '/test' }
|
before { get '/test' }
|
||||||
|
|
||||||
@@ -11,12 +11,16 @@ RSpec.describe(TestController) do
|
|||||||
expect(last_response).to(be_redirect)
|
expect(last_response).to(be_redirect)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Test base route is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it 'Test base route Location header points to /test/list' do
|
it 'Test base route Location header points to /test/list' do
|
||||||
expect(last_response['Location']).to(eq("#{BASE_URL}/test/list"))
|
expect(last_response['Location']).to(eq("#{BASE_URL}/test/list"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /test/list - displays a table of tests
|
# GET /test/list - displays a table of tests
|
||||||
describe 'GET /test/list' do
|
describe 'GET /test/list' do
|
||||||
before { get '/test/list' }
|
before { get '/test/list' }
|
||||||
|
|
||||||
@@ -24,12 +28,16 @@ RSpec.describe(TestController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Test list page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Test list page contains 'List of tests' on page." do
|
it "Test list page contains 'List of tests' on page." do
|
||||||
expect(last_response.body).to(include('List of tests'))
|
expect(last_response.body).to(include('List of tests'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /test/add - form for adding test
|
# GET /test/add - form for adding test
|
||||||
describe 'GET /test/add' do
|
describe 'GET /test/add' do
|
||||||
before { get '/test/add' }
|
before { get '/test/add' }
|
||||||
|
|
||||||
@@ -37,8 +45,124 @@ RSpec.describe(TestController) do
|
|||||||
expect(last_response).to(be_ok)
|
expect(last_response).to(be_ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'Test add page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
it "Test add page contains 'Add new test' on page." do
|
it "Test add page contains 'Add new test' on page." do
|
||||||
expect(last_response.body).to(include('Add new test'))
|
expect(last_response.body).to(include('Add new test'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST /test/add - backend for adding a test
|
||||||
|
describe 'POST /test/add' 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_profile.id],
|
||||||
|
test_description: 'Test for testing'
|
||||||
|
}
|
||||||
|
post '/test/add', request_data
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route is a redirect.' do
|
||||||
|
expect(last_response).to(be_redirect)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route is an HTML response.' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route Location header points to /test/1' do
|
||||||
|
expect(last_response['Location']).to(eq("#{BASE_URL}/test/1"))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route creates new Test.' do
|
||||||
|
expect(Test.count).to(eq(1))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route created test has name.' do
|
||||||
|
expect(Test.first.name).to(eq('Test Test'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route created test has hardware.' do
|
||||||
|
expect(Test.first.hardware.id).to(eq(@hardware.id))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route created test has benchmarks.' do
|
||||||
|
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.benchmark_profiles[0].id).to(eq(@benchmark.id))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test add POST route created test has description.' do
|
||||||
|
expect(Test.first.description).to(eq('Test for testing'))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /test/:test_id - page for viewing a test model
|
||||||
|
describe 'GET /test/:test_id' 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_profile(@benchmark_profile)
|
||||||
|
get "/test/#{@test.id}"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test view page returns 200.' do
|
||||||
|
expect(last_response).to(be_ok)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test view page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test view page contains test name on page.' do
|
||||||
|
expect(last_response.body).to(include("#{@test.name}"))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test view page contains hardware name on page.' do
|
||||||
|
expect(last_response.body).to(include("#{@hardware.name}"))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# GET /test/:test_id/edit - page for editing a test model
|
||||||
|
describe 'GET /test/:test_id/edit' 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_profile(@benchmark_profile)
|
||||||
|
get "/test/#{@test.id}/edit"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test edit page returns 200.' do
|
||||||
|
expect(last_response).to(be_ok)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test edit page is an HTML response' do
|
||||||
|
expect(last_response['Content-Type']).to(include('text/html'))
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'Test edit page contains "Editing: <test name>" on page.' do
|
||||||
|
expect(last_response.body).to(include("Editing: #{@test.name}"))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
require_relative 'base_controller'
|
require_relative 'base_controller'
|
||||||
require_relative '../models/test'
|
require_relative '../models/test'
|
||||||
|
require_relative '../models/benchmark_profile'
|
||||||
|
|
||||||
# / (top-level) routes
|
# / (top-level) routes
|
||||||
class IndexController < BaseController
|
class IndexController < BaseController
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class TestController < BaseController
|
|||||||
benchmarks = Array(params[:test_benchmarks])
|
benchmarks = Array(params[:test_benchmarks])
|
||||||
# associate the benchmarks to the test
|
# associate the benchmarks to the test
|
||||||
benchmarks.each do |b|
|
benchmarks.each do |b|
|
||||||
tst.add_benchmark(b)
|
tst.add_benchmark_profile(b)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect "/test/#{tst.id}"
|
redirect "/test/#{tst.id}"
|
||||||
@@ -81,13 +81,13 @@ class TestController < BaseController
|
|||||||
selected_benchmarks = Array(params[:test_benchmarks])
|
selected_benchmarks = Array(params[:test_benchmarks])
|
||||||
|
|
||||||
# remove benchmarks no longer associated with the test
|
# remove benchmarks no longer associated with the test
|
||||||
tst.benchmarks.dup.each do |b|
|
tst.benchmark_profiles.dup.each do |b|
|
||||||
tst.remove_benchmark(b.id) unless selected_benchmarks.include?(b.id)
|
tst.remove_benchmark_profile(b.id) unless selected_benchmarks.include?(b.id)
|
||||||
end
|
end
|
||||||
|
|
||||||
# associate the benchmarks to the test
|
# associate the benchmarks to the test
|
||||||
selected_benchmarks.each do |b|
|
selected_benchmarks.each do |b|
|
||||||
tst.add_benchmark(b) unless tst.benchmark?(b)
|
tst.add_benchmark_profile(b) unless tst.benchmark?(b)
|
||||||
end
|
end
|
||||||
|
|
||||||
redirect "/test/#{tst.id}"
|
redirect "/test/#{tst.id}"
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
# Benchmark - database model for PC benchmarks
|
# Benchmark - database model for PC benchmarks
|
||||||
class Benchmark < Sequel::Model
|
class Benchmark < Sequel::Model
|
||||||
|
|
||||||
many_to_many :tests
|
one_to_many :benchmark_profiles
|
||||||
one_to_many :results
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
14
src/models/benchmark_profile.rb
Normal file
14
src/models/benchmark_profile.rb
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# BenchmarkProfile - database model for benchmark settings profile
|
||||||
|
class BenchmarkProfile < Sequel::Model
|
||||||
|
|
||||||
|
many_to_one :benchmark
|
||||||
|
many_to_many :tests
|
||||||
|
one_to_many :results
|
||||||
|
|
||||||
|
def display_name
|
||||||
|
"#{benchmark.name} @ #{label}"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
class Result < Sequel::Model
|
class Result < Sequel::Model
|
||||||
|
|
||||||
many_to_one :test
|
many_to_one :test
|
||||||
many_to_one :benchmark
|
many_to_one :benchmark_profile
|
||||||
|
|
||||||
def formatted_score
|
def formatted_score
|
||||||
return @avg_score
|
return @avg_score
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ class Test < Sequel::Model
|
|||||||
|
|
||||||
one_to_many :result
|
one_to_many :result
|
||||||
many_to_one :hardware
|
many_to_one :hardware
|
||||||
many_to_many :benchmarks
|
many_to_many :benchmark_profiles
|
||||||
|
|
||||||
def benchmark?(benchmark_id)
|
def benchmark?(benchmark_profile_id)
|
||||||
return benchmarks_dataset.where(Sequel[:benchmarks][:id] => benchmark_id).any?
|
return benchmark_profiles_dataset.where(Sequel[:benchmark_profiles][:id] => benchmark_profile_id).any?
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -21,29 +21,31 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h3 class="mb-3">Tests using this benchmark:</h3>
|
<h3 class="mb-3">Profiles created for this benchmark:</h3>
|
||||||
|
|
||||||
<% if benchmark.tests.length > 0 %>
|
<% if benchmark.benchmark_profiles.length > 0 %>
|
||||||
<table class="table table-hover table-responsive">
|
<table class="table table-hover table-responsive">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Test title</th>
|
<th>Profile Label</th>
|
||||||
<th>Benchmarks</th>
|
<th>Tests Linked</th>
|
||||||
|
<th>Created at</th>
|
||||||
<th>Last updated</th>
|
<th>Last updated</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% benchmark.tests.each do |t| %>
|
<% benchmark.benchmark_profiles.each do |bp| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
<td><%= bp.display_name %></td>
|
||||||
<td><%= t.benchmarks.length %></td>
|
<td><%= bp.tests.length %></td>
|
||||||
<td><%= t.updated_at %></td>
|
<td><%= bp.created_at %></td>
|
||||||
|
<td><%= bp.updated_at %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>There are no tests associated with this benchmark.</p>
|
<p>There are no profiles associated with this benchmark.</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,16 +8,16 @@
|
|||||||
<table class="table table-hover table-responsive">
|
<table class="table table-hover table-responsive">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Test name</th>
|
<th data-sort="name">Test name</th>
|
||||||
<th># Benchmarks</th>
|
<th data-sort="benchmark-count"># Benchmarks</th>
|
||||||
<th>Last Updated</th>
|
<th data-sort="updated'">Last Updated</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% tests.each do |t| %>
|
<% tests.each do |t| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
||||||
<td><%= t.benchmarks.length %></td>
|
<td><%= t.benchmark_profiles.length %></td>
|
||||||
<td><%= t.updated_at %></td>
|
<td><%= t.updated_at %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||||
|
<link rel="shortcut icon" href="/img/favicon.png">
|
||||||
<title><%= title %> | Game Data</title>
|
<title><%= title %> | Game Data</title>
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/css/bootstrap.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/css/bootstrap.min.css">
|
||||||
<link rel="stylesheet" href="/css/rimmington.css">
|
<link rel="stylesheet" href="/css/rimmington.css">
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<div id="main-nav" class="navbar navbar-expand-md bg-dark border-bottom border-body mb-3" data-bs-theme="dark">
|
<div id="main-nav" class="navbar navbar-expand-md bg-dark border-bottom border-body mb-3" data-bs-theme="dark">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand mb-0 h1" href="#">Game Data</a>
|
<a id="site-title" class="navbar-brand mb-0 h1" href="#">
|
||||||
|
Game Data
|
||||||
|
<img src="/img/app-logo.png" alt="">
|
||||||
|
</a>
|
||||||
|
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
|||||||
@@ -28,8 +28,10 @@
|
|||||||
<label for="test_benchmarks">Benchmarks</label>
|
<label for="test_benchmarks">Benchmarks</label>
|
||||||
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
|
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
|
||||||
<% for b in benchmarks %>
|
<% for b in benchmarks %>
|
||||||
<option value="<%= b.id %>"><%= b.name %></option>
|
<% for bp in b.benchmark_profiles %>
|
||||||
|
<option value="<%= bp.id %>"><%= b.display_name() %></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,10 @@
|
|||||||
<label for="test_benchmarks">Benchmarks</label>
|
<label for="test_benchmarks">Benchmarks</label>
|
||||||
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
|
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
|
||||||
<% for b in benchmarks %>
|
<% for b in benchmarks %>
|
||||||
<option value="<%= b.id %>" <% if test.benchmark?(b.id) %>selected<% end %>><%= b.name %></option>
|
<% for bp in b.benchmark_profiles %>
|
||||||
|
<option value="<%= bp.id %>" <% if test.benchmark?(bp.id) %>selected<% end %>><%= bp.display_name %></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<% tests.each do |t| %>
|
<% tests.each do |t| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
<td><a href="/test/<%= t.id %>"><%= t.name %></a></td>
|
||||||
<td><%= t.benchmarks.length %></td>
|
<td><%= t.benchmark_profiles.length %></td>
|
||||||
<td><%= date_format(t.created_at) %></td>
|
<td><%= date_format(t.created_at) %></td>
|
||||||
<td><%= date_format(t.updated_at) %></td>
|
<td><%= date_format(t.updated_at) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
<div class="col-12 col-md-5 mb-3 mb-md-0">
|
<div class="col-12 col-md-5 mb-3 mb-md-0">
|
||||||
<label for="result_benchmark">Add benchmark result:</label>
|
<label for="result_benchmark">Add benchmark result:</label>
|
||||||
<select class="form-select" id="result_benchmark" name="result_benchmark">
|
<select class="form-select" id="result_benchmark" name="result_benchmark">
|
||||||
<% test.benchmarks.each do |b| %>
|
<% test.benchmark_profiles.each do |b| %>
|
||||||
<option value="<%= b.id %>"><%= b.name %></option>
|
<option value="<%= b.id %>"><%= b.display_name %></option>
|
||||||
<% end %>
|
<% end %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% test.benchmarks.each do |benchmark| %>
|
<% test.benchmark_profiles.each do |benchmark| %>
|
||||||
<tr data-benchmark-id="<%= benchmark.id %>"></tr>
|
<tr data-benchmark-id="<%= benchmark.id %>"></tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user