Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !1473

Migrate to use System Tests

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge system-tests into master Nov 22, 2019
  • Overview 7
  • Commits 1
  • Pipelines 0
  • Changes 36

Created by: seanpdoyle

Migrate from the rspec-rails-provided Feature Tests, to the Rails-provided System Tests.

The most beneficial outcome of this migration is the ability to rely on use_transactional_fixtures = true in browser-driven (JavaScript-enabled).

In order to be System Test compatible, this commit replaces test block declarations made with feature with RSpec.describe, along with calls to scenario with it.

In order to continue to support rails@4.2 and rails@5.0, the test harness must elect to run type: :feature tests when [ActionDispatch::SystemTestCase][system-test-care] is not declared.

In those cases, to preserve compatibility:

  • pass type: :feature instead of type: :system to tests declared in spec/system
  • require database_cleaner gem, along with Feature-test compatible configuration

To achieve this, this commit introduces the SYSTEM_TEST constant, which refers to the correct type: option: :feature for older versions of Rails, :system for newer versions.

Once support for rails@4.2 and rails@5.0 is dropped, these declarations can be removed, and type: SYSTEM_TEST options can be search-and-replaced with type: :system.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: system-tests