From 063729ef12a5c9617373bfcc237281fd5bdfd572 Mon Sep 17 00:00:00 2001 From: Jeremy Prevost Date: Fri, 11 Oct 2024 14:51:28 -0400 Subject: [PATCH] Linting fixups --- test/controllers/graphql_controller_test.rb | 2 +- test/controllers/report_controller_test.rb | 2 ++ test/controllers/static_controller_test.rb | 2 ++ test/helpers/metrics_helper_test.rb | 2 ++ test/models/category_test.rb | 1 + test/models/detector_test.rb | 1 + 6 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/controllers/graphql_controller_test.rb b/test/controllers/graphql_controller_test.rb index 418d503..17a89a3 100644 --- a/test/controllers/graphql_controller_test.rb +++ b/test/controllers/graphql_controller_test.rb @@ -87,7 +87,7 @@ class GraphqlControllerTest < ActionDispatch::IntegrationTest json = response.parsed_body assert_equal('nature', json['data']['logSearchEvent']['detectors']['journals'].first['title']) - assert_equal({"issns"=>["0028-0836", "1476-4687"]}, + assert_equal({ 'issns' => %w[0028-0836 1476-4687] }, json['data']['logSearchEvent']['detectors']['journals'].first['additionalInfo']) end diff --git a/test/controllers/report_controller_test.rb b/test/controllers/report_controller_test.rb index f2b4608..2906629 100644 --- a/test/controllers/report_controller_test.rb +++ b/test/controllers/report_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class ReportControllerTest < ActionDispatch::IntegrationTest diff --git a/test/controllers/static_controller_test.rb b/test/controllers/static_controller_test.rb index 0b911bb..6088d72 100644 --- a/test/controllers/static_controller_test.rb +++ b/test/controllers/static_controller_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class StaticControllerTest < ActionDispatch::IntegrationTest diff --git a/test/helpers/metrics_helper_test.rb b/test/helpers/metrics_helper_test.rb index 574f5da..24c4e3f 100644 --- a/test/helpers/metrics_helper_test.rb +++ b/test/helpers/metrics_helper_test.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'test_helper' class MetricsHelperTest < ActionView::TestCase diff --git a/test/models/category_test.rb b/test/models/category_test.rb index 8480da8..1ad5033 100644 --- a/test/models/category_test.rb +++ b/test/models/category_test.rb @@ -16,6 +16,7 @@ class CategoryTest < ActiveSupport::TestCase test 'duplicate Categories are not allowed' do initial_count = Category.count Category.create!(name: 'Example') + assert_equal(initial_count + 1, Category.count) assert_raises(ActiveRecord::RecordNotUnique) do diff --git a/test/models/detector_test.rb b/test/models/detector_test.rb index 817c041..b4fd66f 100644 --- a/test/models/detector_test.rb +++ b/test/models/detector_test.rb @@ -15,6 +15,7 @@ class DetectorTest < ActiveSupport::TestCase test 'duplicate Detectors are not allowed' do detector_count = Detector.count Detector.create!(name: 'Example') + assert_equal(detector_count + 1, Detector.count) assert_raises(ActiveRecord::RecordNotUnique) do