module Logux::Test::Helpers

Public Class Methods

included(base) click to toggle source
# File lib/logux/test/helpers.rb, line 6
def self.included(base)
  base.before do
    Logux::Test::Store.instance.reset!
  end
end

Public Instance Methods

a_logux_action(attributes = {})
Alias for: a_logux_action_with
a_logux_action_with(attributes = {}) click to toggle source
# File lib/logux/test/helpers.rb, line 25
def a_logux_action_with(attributes = {})
  RSpec::Matchers::BuiltIn::Include.new(attributes.stringify_keys)
end
Also aliased as: a_logux_action
a_logux_meta(attributes = {})
Alias for: a_logux_meta_with
a_logux_meta_with(attributes = {}) click to toggle source
# File lib/logux/test/helpers.rb, line 20
def a_logux_meta_with(attributes = {})
  RSpec::Matchers::BuiltIn::Include.new(attributes.stringify_keys)
end
Also aliased as: a_logux_meta
logux_approved(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 30
def logux_approved(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['approved'], excludes: %w[forbidden error]
  )
end
logux_authenticated(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 54
def logux_authenticated(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['authenticated']
  )
end
logux_denied(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 66
def logux_denied(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['denied']
  )
end
logux_errored(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 48
def logux_errored(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['error']
  )
end
logux_forbidden(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 42
def logux_forbidden(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['forbidden']
  )
end
logux_processed(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 36
def logux_processed(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['processed'], excludes: %w[forbidden error]
  )
end
logux_store() click to toggle source
# File lib/logux/test/helpers.rb, line 12
def logux_store
  Logux::Test::Store.instance.data
end
logux_unauthorized(meta = nil) click to toggle source
# File lib/logux/test/helpers.rb, line 60
def logux_unauthorized(meta = nil)
  Logux::Test::Matchers::ResponseChunks.new(
    meta: meta, includes: ['unauthorized']
  )
end
send_to_logux(*commands) click to toggle source
# File lib/logux/test/helpers.rb, line 16
def send_to_logux(*commands)
  Logux::Test::Matchers::SendToLogux.new(*commands)
end