Skip to content

Update admin dashboard feature spec to system spec #894

@jenpen

Description

@jenpen

Summary:
Rails 5.1 introduced "System Tests", the brave new world of automated testing in Rails. It seems like this has been refined quite a bit and will become more prevalent in Rails 6.0. We'd like to get ahead of the curve on this.

Task:
We need to convert /spec/features/admin/dashboard_spec.rb from a feature spec to a system spec. There are 4 steps to this:

  • Create a similarly named file in the spec/system directory. For example if the file was called happy_spec.rb it would be called happy_system_spec.rb in the new directory.
  • Set each spec’s type as type: :System
  • Use RSpec.describe to define system specs, instead of RSpec.feature
  • Replace the scenario alias in previous feature specs with the standard it syntax

Two files have already been converted that you can use as examples -- the account_system_spec.rb spec and the adjustment_system_spec.rb spec. You can also see the original feature files at account_spec.rb spec and adjustment_spec.rb spec.

More information on system specs can be found below.

Reference

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions