|
14 | 14 | end
|
15 | 15 | end
|
16 | 16 |
|
17 |
| - before do |
18 |
| - @token = Rails.application.secret_key_base |
19 |
| - MiqDatabase.seed |
20 |
| - end |
21 |
| - |
22 |
| - after do |
23 |
| - Rails.application.config.secret_key_base = @token |
24 |
| - Rails.application.secrets = nil if Rails.version < "7.1" |
25 |
| - end |
26 |
| - |
27 |
| - it ".configure_secret_token defaults to MiqDatabase session_secret_token" do |
28 |
| - Rails.application.config.secret_key_base = nil |
29 |
| - |
30 |
| - test_class.configure_secret_token |
31 |
| - expect(Rails.application.secret_key_base).to eq(MiqDatabase.first.session_secret_token) |
32 |
| - expect(Rails.application.config.secret_key_base).to eq(MiqDatabase.first.session_secret_token) |
33 |
| - end |
34 |
| - |
35 |
| - it ".configure_secret_token accepts an input token" do |
36 |
| - Rails.application.config.secret_key_base = nil |
37 |
| - |
38 |
| - token = SecureRandom.hex(64) |
39 |
| - test_class.configure_secret_token(token) |
40 |
| - expect(Rails.application.secret_key_base).to eq(token) |
41 |
| - expect(Rails.application.config.secret_key_base).to eq(token) |
42 |
| - end |
43 |
| - |
44 |
| - it ".configure_secret_token does not reset secrets when token already configured" do |
45 |
| - existing_value = SecureRandom.hex(64) |
46 |
| - Rails.application.config.secret_key_base = existing_value |
47 |
| - Rails.application.secrets = nil if Rails.version < "7.1" |
48 |
| - |
49 |
| - test_class.configure_secret_token |
50 |
| - expect(Rails.application.secret_key_base).to eq(existing_value) |
51 |
| - expect(Rails.application.config.secret_key_base).to eq(existing_value) |
52 |
| - end |
53 |
| - |
54 | 17 | it "#rails_server_options" do
|
55 | 18 | w = FactoryBot.create(:miq_ui_worker, :uri => "http://127.0.0.1:3000")
|
56 | 19 | expect(w.rails_server_options).to include(
|
|
0 commit comments