Commit 7f4abc7c authored by alexpott's avatar alexpott

Issue #2443119 by geertvd: Views preview not working for REST display

parent 02538138
......@@ -292,6 +292,19 @@ public function testLivePreview() {
$this->assertEqual($rendered_json, $expected, 'Ensure the previewed json is escaped.');
}
/**
* Tests the views interface for rest export displays.
*/
public function testSerializerViewsUI() {
$this->drupalLogin($this->adminUser);
// Click the "Update preview button".
$this->drupalPostForm('admin/structure/views/view/test_serializer_display_field/edit/rest_export_1', $edit = array(), t('Update preview'));
$this->assertResponse(200);
// Check if we receive the expected result.
$result = $this->xpath('//div[@id="views-live-preview"]/pre');
$this->assertIdentical($this->drupalGet('test/serialize/field'), (string) $result[0], 'The expected JSON preview output was found.');
}
/**
* Tests the field row style using fieldapi fields.
*/
......
......@@ -502,7 +502,7 @@ public function getRouteName() {
// Check for overridden route names.
$view_route_names = $this->getAlteredRouteNames();
return (isset($view_route_names[$view_route_key]) ? $view_route_names[$view_route_key] : "views.$view_route_key");
return (isset($view_route_names[$view_route_key]) ? $view_route_names[$view_route_key] : "view.$view_route_key");
}
/**
......
......@@ -311,6 +311,24 @@ public function testAlterRoutesWithOptionalParameters() {
$this->assertEquals(array('arg_0' => 'parameter'), $route->getOption('_view_argument_map'));
}
/**
* Tests the getRouteName method.
*/
public function testGetRouteName() {
list($view) = $this->setupViewExecutableAccessPlugin();
$display = array();
$display['display_plugin'] = 'page';
$display['id'] = 'page_1';
$display['display_options'] = array(
'path' => 'test_route',
);
$this->pathPlugin->initDisplay($view, $display);
$route_name = $this->pathPlugin->getRouteName();
// Ensure that the expected routename is returned.
$this->assertEquals('view.test_id.page_1', $route_name);
}
/**
* Returns some mocked view entity, view executable, and access plugin.
*/
......
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