-
Notifications
You must be signed in to change notification settings - Fork 20
/
helpers.rb
59 lines (49 loc) · 1.37 KB
/
helpers.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# frozen_string_literal: true
module Logux
module Test
module Helpers
extend ActiveSupport::Concern
included do
before do
Logux::Test::Store.instance.reset!
end
end
def logux_store
Logux::Test::Store.instance.data
end
def send_to_logux(*commands)
Logux::Test::Matchers::SendToLogux.new(*commands)
end
def be_approved(meta = nil)
Logux::Test::Matchers::ResponseChunks.new(
meta: meta, includes: ['approved'], excludes: %w[forbidden error]
)
end
def be_processed(meta = nil)
Logux::Test::Matchers::ResponseChunks.new(
meta: meta, includes: ['processed'], excludes: %w[forbidden error]
)
end
def be_forbidden(meta = nil)
Logux::Test::Matchers::ResponseChunks.new(
meta: meta, includes: ['forbidden']
)
end
def be_errored(meta = nil)
Logux::Test::Matchers::ResponseChunks.new(
meta: meta, includes: ['error']
)
end
def be_authenticated(meta = nil)
Logux::Test::Matchers::ResponseChunks.new(
meta: meta, includes: ['authenticated']
)
end
def be_unauthorized(meta = nil)
Logux::Test::Matchers::ResponseChunks.new(
meta: meta, includes: ['unauthorized']
)
end
end
end
end