Class: AtlasRb::Reset

Inherits:
Object
  • Object
show all
Extended by:
FaradayHelper
Defined in:
lib/atlas_rb.rb

Overview

Test-environment helper that wipes Atlas state via GET /reset.

Do not call against production. This exists so RSpec suites running against a disposable Atlas instance can return to a clean baseline between examples.

Class Method Summary collapse

Methods included from FaradayHelper

connection, multipart

Class Method Details

.clean(nuid: nil) ⇒ String?

Reset the connected Atlas instance to a clean state.

Examples:

AtlasRb::Reset.clean(nuid: "000000000")

Parameters:

  • nuid (String, nil) (defaults to: nil)

    optional acting user's NUID, forwarded as the User: header. Required for cerberus-token requests; legacy bearer tokens still resolve without it. Atlas's MaintenanceController#reset runs through the standard require_auth filter, so under Atlas 0.6.12+ the header is needed for any cerberus-token caller.

Returns:

  • (String, nil)

    the raw response body from GET /reset.



91
92
93
# File 'lib/atlas_rb.rb', line 91

def self.clean(nuid: nil)
  connection({}, nuid).get("/reset")&.body
end