File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed
openc3-cosmos-script-runner-api/spec Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 2525RSpec . describe CompletedScriptController , :type => :controller do
2626 describe "GET index" do
2727 before ( :each ) do
28+ mock_redis ( )
2829 # Simply stub out ScriptStatusModel to return an empty JSON structure
2930 allow ( OpenC3 ::ScriptStatusModel ) . to receive ( :all ) . and_return ( [ ] )
3031 allow ( OpenC3 ::ScriptStatusModel ) . to receive ( :count ) . and_return ( 0 )
Original file line number Diff line number Diff line change 2020# This file may also be used under the terms of a commercial license
2121# if purchased from OpenC3, Inc.
2222
23+ require 'openc3/script/script'
24+ module OpenC3
25+ module Script
26+ def self . included ( base )
27+ # Empty to override all the fancy stuff in script.rb
28+ end
29+ end
30+ end
31+ include OpenC3 ::Script
32+
2333# This file is copied to spec/ when you run 'rails generate rspec:install'
2434require 'spec_helper'
2535ENV [ 'CI' ] ||= 'true'
Original file line number Diff line number Diff line change 2121
2222module OpenC3
2323 describe OpenC3Authentication do
24+ before ( :each ) do
25+ mock_redis ( )
26+ end
27+
2428 describe "initialize" do
2529 it "raises an error if OPENC3_API_PASSWORD is not set" do
2630 old_password = ENV [ 'OPENC3_API_PASSWORD' ]
@@ -30,17 +34,9 @@ module OpenC3
3034 end
3135
3236 it "initializes with OPENC3_API_PASSWORD" do
33- ENV [ 'OPENC3_API_PASSWORD' ] = 'test_password'
34- auth = OpenC3Authentication . new
35- expect ( auth . token ) . to eq ( 'test_password' )
36- end
37- end
38-
39- describe "token" do
40- it "returns the token from environment" do
41- ENV [ 'OPENC3_API_PASSWORD' ] = 'my_token'
37+ ENV [ 'OPENC3_API_PASSWORD' ] = 'password'
4238 auth = OpenC3Authentication . new
43- expect ( auth . token ) . to eq ( 'my_token' )
39+ expect ( auth . token ) . not_to be_nil # it should be some random string (session token )
4440 end
4541 end
4642 end
You can’t perform that action at this time.
0 commit comments