diff --git a/.woodpecker.yml b/.woodpecker.yml index e8e2ce7..fc00489 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -26,7 +26,7 @@ steps: commands: - gem install rake - bundle config set --local path "vendor/bundle" - - rake test:rubocop + - rake test:lint gitea_release: image: plugins/gitea-release diff --git a/Rakefile b/Rakefile index c086e9c..2b4fe1e 100644 --- a/Rakefile +++ b/Rakefile @@ -32,7 +32,7 @@ namespace :test do system("rspec") end - task :rubocop do + task :lint do system("rubocop src/ spec/") end end diff --git a/spec/controllers/benchmark_controller_spec.rb b/spec/controllers/benchmark_controller_spec.rb index 7671a55..5981cbd 100644 --- a/spec/controllers/benchmark_controller_spec.rb +++ b/spec/controllers/benchmark_controller_spec.rb @@ -7,8 +7,11 @@ RSpec.describe(BenchmarkController) do describe 'GET /benchmark' do before { get '/benchmark' } - it 'Benchmark base route redirects to /benchmark/list' do + 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 diff --git a/spec/controllers/hardware_controller_spec.rb b/spec/controllers/hardware_controller_spec.rb index 1ba1c23..6e0235c 100644 --- a/spec/controllers/hardware_controller_spec.rb +++ b/spec/controllers/hardware_controller_spec.rb @@ -7,8 +7,11 @@ RSpec.describe(HardwareController) do describe 'GET /hardware' do before { get '/hardware' } - it 'Hardware base route redirects to /hardware/list' do + it 'Hardware base route is a redirect' do expect(last_response).to(be_redirect) + end + + it 'Hardware base route Location header points to /hardware/list' do expect(last_response['Location']).to(eq("#{BASE_URL}/hardware/list")) end end diff --git a/spec/controllers/test_controller_spec.rb b/spec/controllers/test_controller_spec.rb index d8e40bf..8b74707 100644 --- a/spec/controllers/test_controller_spec.rb +++ b/spec/controllers/test_controller_spec.rb @@ -7,8 +7,11 @@ RSpec.describe(TestController) do describe 'GET /test' do before { get '/test' } - it 'Test base route redirects to /test/list' do + it 'Test base route is a redirect' do expect(last_response).to(be_redirect) + end + + it 'Test base route Location header points to /test/list' do expect(last_response['Location']).to(eq("#{BASE_URL}/test/list")) end end diff --git a/src/config.rb b/src/config.rb index 3027d98..1fda1ec 100644 --- a/src/config.rb +++ b/src/config.rb @@ -12,7 +12,6 @@ class Config @data = YAML.load_file(DEFAULT_CONFIG) # merge in user-defined configuration if it exists - puts "Merging #{config_path} with #{DEFAULT_CONFIG}." @data.merge!(YAML.load_file(config_path)) if File.exist?(config_path) end