Skip to content

Commit 20e9abb

Browse files
committed
fix up serverless spec tests
1 parent 97015be commit 20e9abb

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

spec/serverless_spec.rb

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@
9999
expect(resource["Properties"]["EngineVersion"]).to eq(14.6)
100100
end
101101

102-
it "to have property EngineMode" do
103-
expect(resource["Properties"]["EngineMode"]).to eq("serverless")
104-
end
105-
106102
it "to have property DBClusterParameterGroupName" do
107103
expect(resource["Properties"]["DBClusterParameterGroupName"]).to eq({"Ref"=>"DBClusterParameterGroup"})
108104
end
@@ -139,8 +135,12 @@
139135
expect(resource["Properties"]["Tags"]).to eq([{"Key"=>"Name", "Value"=>{"Fn::Sub"=>"${EnvironmentName}-aurora-postgres"}}, {"Key"=>"Environment", "Value"=>{"Ref"=>"EnvironmentName"}}, {"Key"=>"EnvironmentType", "Value"=>{"Ref"=>"EnvironmentType"}}])
140136
end
141137

142-
it "to have property ScalingConfiguration" do
143-
expect(resource["Properties"]["ScalingConfiguration"]).to eq({"AutoPause"=>{"Ref"=>"AutoPause"}, "MinCapacity"=>{"Ref"=>"MinCapacity"}, "MaxCapacity"=>{"Ref"=>"MaxCapacity"}, "SecondsUntilAutoPause"=>{"Ref"=>"SecondsUntilAutoPause"}})
138+
it "to have property EnableHttpEndpoint" do
139+
expect(resource["Properties"]["EnableHttpEndpoint"]).to eq({"Ref"=>"EnableHttpEndpoint"})
140+
end
141+
142+
it "to have property ServerlessV2ScalingConfiguration" do
143+
expect(resource["Properties"]["ServerlessV2ScalingConfiguration"]).to eq({"MinCapacity"=>{"Ref"=>"MinCapacity"}, "MaxCapacity"=>{"Ref"=>"MaxCapacity"}})
144144
end
145145

146146
end
@@ -166,6 +166,27 @@
166166

167167
end
168168

169+
context "ServerlessDBInstance" do
170+
let(:resource) { template["Resources"]["ServerlessDBInstance"] }
171+
172+
it "is of type AWS::RDS::DBInstance" do
173+
expect(resource["Type"]).to eq("AWS::RDS::DBInstance")
174+
end
175+
176+
it "to have property Engine" do
177+
expect(resource["Properties"]["Engine"]).to eq("aurora-postgresql")
178+
end
179+
180+
it "to have property DBInstanceClass" do
181+
expect(resource["Properties"]["DBInstanceClass"]).to eq("db.serverless")
182+
end
183+
184+
it "to have property DBClusterIdentifier" do
185+
expect(resource["Properties"]["DBClusterIdentifier"]).to eq({"Ref"=>"DBCluster"})
186+
end
187+
188+
end
189+
169190
context "DBHostRecord" do
170191
let(:resource) { template["Resources"]["DBHostRecord"] }
171192

0 commit comments

Comments
 (0)