File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 1212 config . filter_run_excluding ( :qpid_proton ) unless ENV [ 'CI' ] || Gem . loaded_specs . key? ( :qpid_proton )
1313end
1414
15- def fix_token_expires_at ( interaction )
16- data = JSON . parse ( interaction . response . body )
17- data [ "token" ] [ "expires_at" ] = "9999-12-31T23:59:59.999999Z"
18- interaction . response . body = data . to_json . force_encoding ( 'ASCII-8BIT' )
19- end
20-
2115VCR . configure do |config |
2216 config . ignore_hosts 'codeclimate.com' if ENV [ 'CI' ]
2317 config . cassette_library_dir = File . join ( ManageIQ ::Providers ::Openstack ::Engine . root , 'spec/vcr_cassettes' )
2418
25- config . before_record do |interaction |
26- fix_token_expires_at ( interaction ) if interaction . request . uri . end_with? ( "v3/auth/tokens" )
27- end
19+ fix_token_expires_at ( config )
2820
2921 secrets = Rails . application . secrets
3022 secrets . openstack . each_key do |secret |
Original file line number Diff line number Diff line change 1+ def fix_token_expires_at_interaction ( interaction )
2+ return unless interaction . request . uri . end_with? ( "v3/auth/tokens" )
3+
4+ data = JSON . parse ( interaction . response . body )
5+ return if data . dig ( "token" , "expires_at" ) . nil?
6+
7+ data [ "token" ] [ "expires_at" ] = "9999-12-31T23:59:59.999999Z"
8+ interaction . response . body = data . to_json . force_encoding ( 'ASCII-8BIT' )
9+ end
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