|
64 | 64 | it 'shoud not rais an error' do |
65 | 65 | expect { rds_utils.modify_security_group('testDb', ['sg-084646']) }.not_to raise_error |
66 | 66 | end |
| 67 | + |
| 68 | + it 'should get the correct default parameters' do |
| 69 | + expect(rds_client).to receive(:modify_db_instance).with(db_instance_identifier: 'testDb', |
| 70 | + vpc_security_group_ids: ['sg-084646'], |
| 71 | + apply_immediately: true, |
| 72 | + copy_tags_to_snapshot: true) |
| 73 | + rds_utils.modify_security_group('testDb', ['sg-084646']) |
| 74 | + end |
67 | 75 | end |
68 | 76 |
|
69 | 77 | describe '#modify_option_group' do |
70 | 78 | it 'shoud not rais an error' do |
71 | 79 | expect { rds_utils.modify_option_group('testDb', 'options-group') }.not_to raise_error |
72 | 80 | end |
| 81 | + |
| 82 | + it 'should get the correct default parameters' do |
| 83 | + expect(rds_client).to receive(:modify_db_instance).with(db_instance_identifier: 'testDb', |
| 84 | + option_group_name: 'options-group', |
| 85 | + apply_immediately: true, |
| 86 | + copy_tags_to_snapshot: true) |
| 87 | + rds_utils.modify_option_group('testDb', 'options-group') |
| 88 | + end |
| 89 | + end |
| 90 | + |
| 91 | + describe '#modify_db_instance' do |
| 92 | + it 'should allow your to override default values' do |
| 93 | + expect(rds_client).to receive(:modify_db_instance).with(db_instance_identifier: 'testDb', |
| 94 | + option_group_name: 'options-group', |
| 95 | + apply_immediately: false, |
| 96 | + copy_tags_to_snapshot: false) |
| 97 | + rds_utils.modify_db_instance( |
| 98 | + db_instance_identifier: 'testDb', |
| 99 | + option_group_name: 'options-group', |
| 100 | + apply_immediately: false, |
| 101 | + copy_tags_to_snapshot: false |
| 102 | + ) |
| 103 | + end |
73 | 104 | end |
74 | 105 | end |
75 | 106 |
|
76 | 107 | context 'while describe_db_instances returns an instand not found error' do |
77 | 108 | before do |
78 | 109 | rds_client.stub_responses( |
79 | 110 | :describe_db_instances, |
80 | | - Aws::RDS::Errors::DBInstanceNotFound.new('test', 'test') |
81 | | - ) |
82 | | - rds_client.stub_responses( |
83 | | - :restore_db_instance_from_db_snapshot, |
84 | | - db_instance: { |
85 | | - db_instance_identifier: 'testDb' |
86 | | - } |
| 111 | + [ |
| 112 | + Aws::RDS::Errors::DBInstanceNotFound.new('test', 'test'), |
| 113 | + { db_instances: [ |
| 114 | + db_instance_identifier: 'testDb', |
| 115 | + db_instance_status: 'available' |
| 116 | + ] } |
| 117 | + ] |
87 | 118 | ) |
88 | 119 | rds_client.stub_responses( |
89 | 120 | :describe_db_snapshots, |
|
116 | 147 | end |
117 | 148 | end |
118 | 149 |
|
119 | | - context 'while describe_db_instances is returns an instand not found error' do |
| 150 | + context 'while describe_db_instances is mocked out' do |
120 | 151 | before do |
121 | 152 | rds_client.stub_responses( |
122 | 153 | :delete_db_instance, |
|
0 commit comments