blob: a6506c035a6e2d1575a879d80754d640a7f2a517 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
module Support
module Webmock
module Helpers
def stub_headers(*args)
{headers: make_headers(*args)}
end
def make_headers(headers={}, authorization_token:)
headers.merge('Authorization' => "Token token=#{authorization_token.inspect}")
end
def with_stubbed_request( method, uri, &blk )
stub_request(method, uri).tap(&blk)
end
end
end
end
RSpec.configure do | conf |
conf.include Support::Webmock::Helpers, type: :model
conf.include Support::Webmock::Helpers, type: :worker
end
|