All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
45 lines
1.2 KiB
Ruby
45 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative '../spec_helper'
|
|
|
|
RSpec.describe(BenchmarkController) do
|
|
# /benchmark - redirects to /benchmark/list
|
|
describe 'GET /benchmark' do
|
|
before { get '/benchmark' }
|
|
|
|
it 'Benchmark base route is a redirect' do
|
|
expect(last_response).to(be_redirect)
|
|
end
|
|
|
|
it 'Benchmark base route Location header points to /benchmark/list' do
|
|
expect(last_response['Location']).to(eq("#{BASE_URL}/benchmark/list"))
|
|
end
|
|
end
|
|
|
|
# /benchmark/list - displays a table of benchmarks
|
|
describe 'GET /benchmark/list' do
|
|
before { get '/benchmark/list' }
|
|
|
|
it 'Benchmark list page returns 200.' do
|
|
expect(last_response).to(be_ok)
|
|
end
|
|
|
|
it "Benchmark list page contains 'List of benchmarks' on page." do
|
|
expect(last_response.body).to(include('List of benchmarks'))
|
|
end
|
|
end
|
|
|
|
# /benchmark/add - form for adding benchmark
|
|
describe 'GET /benchmark/add' do
|
|
before { get '/benchmark/add' }
|
|
|
|
it 'Benchmark add page returns 200.' do
|
|
expect(last_response).to(be_ok)
|
|
end
|
|
|
|
it "Benchmark add page contains 'Add new benchmark' on page." do
|
|
expect(last_response.body).to(include('Add new benchmark'))
|
|
end
|
|
end
|
|
end
|