Allow skipping master key
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
require "test_helper"
|
||||
require "mrsk/configuration"
|
||||
|
||||
ENV["RAILS_MASTER_KEY"] = "456"
|
||||
|
||||
class ConfigurationTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
ENV["RAILS_MASTER_KEY"] = "456"
|
||||
|
||||
@deploy = {
|
||||
service: "app", image: "dhh/app",
|
||||
registry: { "username" => "dhh", "password" => "secret" },
|
||||
@@ -21,6 +21,10 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
@config_with_roles = Mrsk::Configuration.new(@deploy_with_roles)
|
||||
end
|
||||
|
||||
teardown do
|
||||
ENV["RAILS_MASTER_KEY"] = nil
|
||||
end
|
||||
|
||||
test "ensure valid keys" do
|
||||
assert_raise(ArgumentError) do
|
||||
Mrsk::Configuration.new(@deploy.tap { _1.delete(:service) })
|
||||
@@ -134,6 +138,11 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
assert_equal "456", @config.master_key
|
||||
end
|
||||
|
||||
test "skip master key" do
|
||||
config = Mrsk::Configuration.new(@deploy.tap { |c| c[:skip_master_key] = true })
|
||||
assert_nil @config.master_key
|
||||
end
|
||||
|
||||
test "volume_args" do
|
||||
assert_equal ["--volume", "/local/path:/container/path"], @config.volume_args
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user