Skip to content

Commit

Permalink
Merge pull request #57 from Gizra/56-routing-path
Browse files Browse the repository at this point in the history
Fix config menu route
  • Loading branch information
jhedstrom authored Nov 11, 2016
2 parents 78e52c3 + a68bfbd commit 4edc413
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion message_subscribe.links.menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ message_subscribe.admin_settings:
route_name: message_subscribe.admin_settings
title: 'Message subscribe settings'
description: 'Administer message subscribe'
parent: system.admin_config_system
parent: message.main_settings
2 changes: 1 addition & 1 deletion message_subscribe.routing.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
message_subscribe.admin_settings:
path: /admin/config/system/message-subscribe
path: /admin/config/message/message-subscribe
defaults:
_title: 'Message subscribe settings'
_form: \Drupal\message_subscribe\Form\MessageSubscribeAdminSettings
Expand Down
39 changes: 39 additions & 0 deletions tests/src/Functional/MenuTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Drupal\Tests\message_subscribe\Functional;

use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;

/**
* Tests menus for the message subscribe module.
*
* @group message_subscribe
*/
class MenuTest extends BrowserTestBase {

/**
* {@inheritdoc}
*/
public static $modules = ['message_subscribe'];

/**
* Test that the menu links are working properly.
*/
public function testMenuLinks() {
$admin = $this->drupalCreateUser([], NULL, TRUE);
$this->drupalLogin($admin);

// Link should appear on main config page.
$this->drupalGet(Url::fromRoute('system.admin_config'));
$this->assertSession()->linkExists(t('Message subscribe settings'));

// Link should be on the message-specific overview page.
$this->drupalGet(Url::fromRoute('message.main_settings'));
$this->assertSession()->linkExists(t('Message subscribe settings'));

$this->clickLink(t('Message subscribe settings'));
$this->assertSession()->statusCodeEquals(200);
}

}

0 comments on commit 4edc413

Please sign in to comment.