Skip to content

Commit 435b45d

Browse files
committed
fix everything for real this time :)
1 parent a1e39d6 commit 435b45d

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

openc3-cosmos-cmd-tlm-api/spec/rails_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
abort("The Rails environment is running in production mode!") if Rails.env.production?
2929
require '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

openc3-cosmos-cmd-tlm-api/spec/spec_helper.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
ENV['OPENC3_REDIS_EPHEMERAL_HOSTNAME'] = '127.0.0.1'
7474
ENV['OPENC3_REDIS_EPHEMERAL_PORT'] = '6380'
7575
# Set some usernames / passwords
76-
ENV['OPENC3_API_PASSWORD'] = 'openc3'
76+
ENV['OPENC3_API_PASSWORD'] = 'password'
7777
ENV['OPENC3_SERVICE_PASSWORD'] = 'openc3service'
7878
ENV['OPENC3_REDIS_USERNAME'] = 'openc3'
7979
ENV['OPENC3_REDIS_PASSWORD'] = 'openc3password'
@@ -84,6 +84,17 @@
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

8899
def setup_system(targets = ["SYSTEM", "INST", "EMPTY"])
89100
require 'openc3/system'

openc3-cosmos-script-runner-api/spec/rails_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
abort("The Rails environment is running in production mode!") if Rails.env.production?
3030
require '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

0 commit comments

Comments
 (0)