Skip to content

Speed up security feature specs

Robert Speicher requested to merge rs-security-spec-speed into master

Before: rspec spec/features/security/ 0.12s user 0.04s system 0% cpu 3:38.00 total

After: rspec spec/features/security/ 0.12s user 0.04s system 0% cpu 1:40.58 total

The majority of the speed improvements is from two things:

  1. Instead of using our standard login_as helper in the matchers, we take advantage of the Warden::Test::Helpers version of the method which bypasses the login form and logs the user in directly. We were essentially testing that filling out the login form works hundreds of times.
  2. There were many tests that verified if a user of a certain access level (master, owner, reporter, guest) had access to a resource. Unfortunately we were creating every type of user for each test even though a test was only verifying one of them at a time. Now the tests only create the one user role they're testing.

Merge request reports