Commit 4ed293f8 authored by dawehner's avatar dawehner Committed by tim.plunkett
Browse files

Add tests to save and load the view and see that the config stays the same.

parent 72c58505
......@@ -158,6 +158,20 @@ function testConfigurableCRUD() {
$config = config('views.view.archive_copy');
$this->assertTrue($config->isNew(), 'Deleted config is now new.');
// Check whether load, save and load produce the same kind of view.
$values = config('views.view.archive')->get();
$created = $controller->create($values);
$created->save();
$loaded_entities = $controller->load(array($created->id()));
$created_loaded = reset($loaded_entities);
$values_loaded = config('views.view.archive')->get();
$this->assertTrue(isset($created_loaded->display['default']->display_options), 'Make sure that the display options exists.');
$this->assertEqual($created_loaded->display['default']->display_plugin, 'default', 'Make sure the right display plugin is set.');
$this->assertEqual($values, $values_loaded, 'The loaded config is the same as the original loaded one.');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment