Sha256: 6a67d76345af562fa4752c02e1cf86701b57252307ce07cb1b866715a867f2a0
Contents?: true
Size: 678 Bytes
Versions: 15
Compression:
Stored size: 678 Bytes
Contents
module Ctws module ControllerSpecHelper # generate tokens from user id def token_generator(user_id) Ctws::JsonWebToken.encode(user_id: user_id) end # generate expired tokens from user id def expired_token_generator(user_id) Ctws::JsonWebToken.encode({ user_id: user_id }, (Time.now.to_i - 10)) end # return valid headers def valid_headers { "Authorization" => token_generator(ctws_user.id), "Content-Type" => "application/json" } end # return invalid headers def invalid_headers { "Authorization" => nil, "Content-Type" => "application/json" } end end end
Version data entries
15 entries across 15 versions & 1 rubygems