Skip to content
Snippets Groups Projects
Select Git revision
  • 509430-update-tests
  • 505173-add-scheduled-pipeline-selection-in-dropdown
  • 505352-update-project-level-feature-flag
  • 504215-remove-strategy_add_to_merge_train_when_pipeline_succeeds-auto-merge-strategy
  • quarantine-flaky-tests-ee-spec-services-app_sec-fuzzing-coverage-corpuses-create_service_spec-rb-44
  • quarantine-flaky-tests-spec-lib-gitlab-database-query_analyzers-prevent_cross_database_modification_spec-rb-138
  • quarantine-flaky-tests-ee-spec-db-seeds-data_seeder-bulk_data_spec-rb-6
  • quarantine-flaky-tests-spec-lib-gitlab-error_tracking-error_repository-open_api_strategy_spec-rb-215
  • quarantine-flaky-tests-ee-spec-models-incident_management-issuable_escalation_status_spec-rb-48
  • quarantine-flaky-tests-spec-models-concerns-cross_database_ignored_tables_spec-rb-133
  • quarantine-flaky-tests-spec-models-concerns-cross_database_ignored_tables_spec-rb-176
  • quarantine-flaky-tests-spec-lib-gitlab-background_migration-backfill_partitioned_web_hook_logs_daily_spec-rb-49
  • 517477-feature-flag-rollout-of-process_auto_merge_on_load
  • cherryhan-master-patch-bd7d
  • overdue-finalize-background-migration--backfill-ci-build-trace-metadata-project-id
  • overdue-finalize-background-migration--backfill-ci-secure-file-states-project-id
  • overdue-finalize-background-migration--backfill-ci-job-artifact-states-project-id
  • overdue-finalize-background-migration--backfill-protected-environment-deploy-access-levels-protected-environment-group-id
  • overdue-finalize-background-migration--backfill-ml-candidate-params-project-id
  • overdue-finalize-background-migration--make-security-policy-bots-private
  • v17.7.6-ee protected
  • v17.8.4-ee protected
  • v17.9.1-ee protected
  • v17.8.3-ee protected
  • v17.7.5-ee protected
  • v17.9.0-ee protected
  • v17.9.0-rc42-ee protected
  • v17.6.5-ee protected
  • v17.7.4-ee protected
  • v17.8.2-ee protected
  • v17.6.4-ee protected
  • v17.7.3-ee protected
  • v17.8.1-ee protected
  • v17.8.0-ee protected
  • v17.7.2-ee protected
  • v17.8.0-rc42-ee protected
  • v17.5.5-ee protected
  • v17.6.3-ee protected
  • v17.7.1-ee protected
  • v17.7.0-ee protected
40 results

next_found_instance_of.rb

  • Mehmet Emin INAC's avatar
    acdc0b87
    Implement `(allow|expect)_next_found_instance_of` mock helpers · acdc0b87
    Mehmet Emin INAC authored
    Since ActiveRecord is instantiating the objects directly by calling
    `.allocate` on the model classes, mocking with `next_instance_of` mock
    helpers is not possible as it is depending on the `.new` method being
    called. To make it possible to mock next instance of ActiveRecord
    models, we had to implement a new set of mock helpers which rely on
    the `.allocate` method to be called.
    Verified
    acdc0b87
    History
    Implement `(allow|expect)_next_found_instance_of` mock helpers
    Mehmet Emin INAC authored
    Since ActiveRecord is instantiating the objects directly by calling
    `.allocate` on the model classes, mocking with `next_instance_of` mock
    helpers is not possible as it is depending on the `.new` method being
    called. To make it possible to mock next instance of ActiveRecord
    models, we had to implement a new set of mock helpers which rely on
    the `.allocate` method to be called.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.