test/models/sql/test_database.rb in fog-azure-rm-0.1.2 vs test/models/sql/test_database.rb in fog-azure-rm-0.2.0
- old
+ new
@@ -3,10 +3,11 @@
# Test class for Database Model
class TestDatabase < Minitest::Test
def setup
@service = Fog::Sql::AzureRM.new(credentials)
@database = database(@service)
+ @database_client = @service.instance_variable_get(:@sql_mgmt_client)
end
def test_model_methods
methods = [
:save,
@@ -35,21 +36,19 @@
:elastic_pool_name,
:location,
:max_size_bytes,
:requested_service_objective_id,
:requested_service_objective_name,
- :restore_point_in_time,
:service_level_objective,
- :source_database_id,
- :source_database_deletion_date
+ :source_database_id
]
attributes.each do |attribute|
assert_respond_to @database, attribute
end
end
def test_save_method_response
- create_response = ApiStub::Models::Sql::SqlDatabase.create_database
+ create_response = ApiStub::Models::Sql::SqlDatabase.create_database(@database_client)
@service.stub :create_or_update_database, create_response do
assert_instance_of Fog::Sql::AzureRM::SqlDatabase, @database.save
end
end