File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1616 config . ignore_hosts 'codeclimate.com' if ENV [ 'CI' ]
1717 config . cassette_library_dir = File . join ( ManageIQ ::Providers ::Openstack ::Engine . root , 'spec/vcr_cassettes' )
1818
19- config . before_record do |interaction |
20- fix_token_expires_at ( interaction ) if interaction . request . uri . end_with? ( "v3/auth/tokens" )
21- end
19+ fix_token_expires_at ( config )
2220
2321 secrets = Rails . application . secrets
2422 secrets . openstack . each_key do |secret |
Original file line number Diff line number Diff line change 1- def fix_token_expires_at ( interaction )
1+ def fix_token_expires_at_interaction ( interaction )
2+ return unless interaction . request . uri . end_with? ( "v3/auth/tokens" )
3+
24 data = JSON . parse ( interaction . response . body )
35 return if data . dig ( "token" , "expires_at" ) . nil?
46
57 data [ "token" ] [ "expires_at" ] = "9999-12-31T23:59:59.999999Z"
68 interaction . response . body = data . to_json . force_encoding ( 'ASCII-8BIT' )
79end
10+
11+ def fix_token_expires_at ( config )
12+ config . before_record { |interaction | fix_token_expires_at_interaction ( interaction ) }
13+ end
You can’t perform that action at this time.
0 commit comments