Module: RailsAuditLog::Graphql::Testing::RSpecMatchers
- Defined in:
- lib/rails_audit_log/graphql/testing/rspec_matchers.rb
Overview
RSpec matchers for asserting GraphQL audit log entries in a query response.
Include this module in your RSpec configuration to use the #have_graphql_audit_entry matcher:
RSpec.configure do |config|
config.include RailsAuditLog::Graphql::Testing::RSpecMatchers
end
Or include it in a single example group:
RSpec.describe "audit logging" do
include RailsAuditLog::Graphql::Testing::RSpecMatchers
end
The matcher inspects the auditLogEntries and auditLogEntriesConnection.nodes keys in the response data. To use the touching chain, include diff { attribute } in your GraphQL query.
Defined Under Namespace
Classes: HaveGraphqlAuditEntry
Instance Method Summary collapse
-
#have_graphql_audit_entry(event) ⇒ HaveGraphqlAuditEntry
Returns a matcher that asserts a GraphQL response contains an audit log entry with the given event type.
Instance Method Details
#have_graphql_audit_entry(event) ⇒ HaveGraphqlAuditEntry
Returns a matcher that asserts a GraphQL response contains an audit log entry with the given event type.
41 42 43 |
# File 'lib/rails_audit_log/graphql/testing/rspec_matchers.rb', line 41 def have_graphql_audit_entry(event) HaveGraphqlAuditEntry.new(event.to_s) end |