Sha256: 42c61168597a408aa7b1fce4569678c46b202d1cad22f0f90bc664ea54b23bfd

Contents?: true

Size: 863 Bytes

Versions: 33

Compression:

Stored size: 863 Bytes

Contents

require 'test_helper'
require 'performance_test_help'

class ListPeoplePerformanceTest < 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
    200.times do |i|
      p = Person.create(first_name: "Name#{i}", last_name: 'Last')
      p.buildings = Array.new(4) { |j| Building.create name: "B#{j} of #{p.first_name}" } unless (i % 4).zero?
    end
    PeopleController.class_eval do
      before_action :setup
      def list_columns
        active_scaffold_config.columns.select { |col| %i[first_name last_name buildings].include?(col.name) }
      end

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

  def test_list
    get '/people'
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

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