Speed up security feature specs
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:
- Instead of using our standard
login_as
helper in the matchers, we take advantage of theWarden::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. - 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.