File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
openc3-cosmos-cmd-tlm-api/spec
openc3-cosmos-script-runner-api/spec Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 2828abort ( "The Rails environment is running in production mode!" ) if Rails . env . production?
2929require 'rspec/rails'
3030# Add additional requires below this line. Rails is not loaded until this point!
31+ load 'openc3/io/json_rpc.rb' # This is here because we need our as_json to override Rails'
3132
3233# Requires supporting ruby files with custom matchers and macros, etc, in
3334# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
Original file line number Diff line number Diff line change 7373ENV [ 'OPENC3_REDIS_EPHEMERAL_HOSTNAME' ] = '127.0.0.1'
7474ENV [ 'OPENC3_REDIS_EPHEMERAL_PORT' ] = '6380'
7575# Set some usernames / passwords
76- ENV [ 'OPENC3_API_PASSWORD' ] = 'openc3 '
76+ ENV [ 'OPENC3_API_PASSWORD' ] = 'password '
7777ENV [ 'OPENC3_SERVICE_PASSWORD' ] = 'openc3service'
7878ENV [ 'OPENC3_REDIS_USERNAME' ] = 'openc3'
7979ENV [ 'OPENC3_REDIS_PASSWORD' ] = 'openc3password'
8484
8585$openc3_scope = ENV [ 'OPENC3_SCOPE' ]
8686$openc3_token = ENV [ 'OPENC3_API_PASSWORD' ]
87+ $openc3_mock_token = 'mock_token'
88+
89+ # Mock the HTTP request for OpenC3Authentication
90+ require 'openc3/utilities/authentication'
91+ OpenC3 ::OpenC3Authentication . class_eval do
92+ def _make_auth_request ( password )
93+ mock_response = Object . new
94+ mock_response . define_singleton_method ( :body ) { $openc3_mock_token }
95+ mock_response
96+ end
97+ end
8798
8899def setup_system ( targets = [ "SYSTEM" , "INST" , "EMPTY" ] )
89100 require 'openc3/system'
Original file line number Diff line number Diff line change 2929abort ( "The Rails environment is running in production mode!" ) if Rails . env . production?
3030require 'rspec/rails'
3131# Add additional requires below this line. Rails is not loaded until this point!
32+ load 'openc3/io/json_rpc.rb' # This is here because we need our as_json to override Rails'
3233
3334# Requires supporting ruby files with custom matchers and macros, etc, in
3435# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
You can’t perform that action at this time.
0 commit comments