test/deploy_test.rb in eb_deployer-0.0.8 vs test/deploy_test.rb in eb_deployer-0.0.9

- old
+ new

@@ -1,5 +1,6 @@ +$:.unshift(File.expand_path("../../lib", __FILE__)) require 'tempfile' require 'eb_deployer' require 'aws_driver_stubs' require 'minitest/autorun' @@ -10,10 +11,16 @@ @cf_driver = CFStub.new @sample_package = '/tmp/app-package.war' File.open(@sample_package, 'w') { |f| f << 's' * 100 } end + def test_first_deplyment_create_eb_application + assert !@eb_driver.application_exists?('simple') + deploy(:application => 'simple', :environment => "production") + assert @eb_driver.application_exists?('simple') + end + def test_first_deployment_create_environment assert !@eb_driver.environment_exists?('simple', eb_envname('simple', 'production')) deploy(:application => 'simple', :environment => "production") assert @eb_driver.environment_exists?('simple', eb_envname('simple', 'production')) end @@ -153,17 +160,29 @@ :template => cf_template }) assert @cf_driver.stack_exists?('simple-production') end - def test_transforms_resource_provsion_output_to_elastic_beanstalk_settings + def test_provision_resources_with_capacities cf_template = temp_file(JSON.dump({'Resources' => {'R1' => {}}})) deploy(:application => 'simple', :environment => "production", :resources => { - :template => cf_template + :template => cf_template, + :capabilities => ['CAPABILITY_IAM'] }) - assert @cf_driver.stack_exists?('simple-production') + assert_equal ['CAPABILITY_IAM'], @cf_driver.stack_config('simple-production')[:capabilities] end + + def test_provision_resources_with_parameters + cf_template = temp_file(JSON.dump({'Resources' => {'R1' => {}}})) + deploy(:application => 'simple', :environment => "production", + :resources => { + :template => cf_template, + :parameters => {'a' => 1} + }) + assert_equal({'a' => 1 }, @cf_driver.stack_config('simple-production')[:parameters]) + end + def test_transforms_resource_provsion_output_to_elastic_beanstalk_settings cf_template = temp_file(JSON.dump({ 'Resources' => {'R1' => {}}, 'Outputs' => {'O1' => {}, 'O2' => {}}