Sha256: dc777a890937f80e8f14a72d427a8cf741000830c1dae3172708660b95be76ba

Contents?: true

Size: 776 Bytes

Versions: 33

Compression:

Stored size: 776 Bytes

Contents

require 'test_helper'
require 'performance_test_help'

class ListCarsPerformanceTest < ActionDispatch::PerformanceTest
  self.profile_options =
    if ENV['BENCHMARK_TESTS']
      {metrics: [:wall_time]}
    else
      {metrics: %i[process_time], formats: %i[flat graph_html call_stack]}
    end
  def setup
    owners = Array.new(4) { |i| Person.create first_name: "Name#{i}" } << nil
    500.times { |i| Car.create(brand: 'Skoda', model: 'Fabia', person: owners[i % 5]) }
    CarsController.class_eval do
      before_action :setup

      def setup
        active_scaffold_config.list.pagination = false
      end
    end
  end

  def test_list
    get '/cars'
  end

  # def test_list2
  #   get '/cars?t=2'
  # end
  #
  # def test_list3
  #   get '/cars?t=3'
  # end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
active_scaffold-3.7.12 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.11.1 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.11 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.10 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.8 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.7 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.6 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.5 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.2 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.1 test/performance/list_cars_performance_test.rb
active_scaffold-3.7.0 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.20 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.19 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.17 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.15 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.14 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.13 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.12 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.11.1 test/performance/list_cars_performance_test.rb
active_scaffold-3.6.11 test/performance/list_cars_performance_test.rb