Added Subscribers empty page, with test.

This commit is contained in:
marco
2015-08-18 16:57:13 +02:00
parent fd0cc96fb2
commit 347706e119
5 changed files with 58 additions and 3 deletions

View File

@ -34,6 +34,14 @@ class Menu {
'mailpoet-settings',
array($this, 'settings')
);
add_submenu_page(
'mailpoet',
'Subscribers',
'Subscribers',
'manage_options',
'mailpoet-subscribers',
array($this, 'subscribers')
);
}
function home() {
@ -45,4 +53,9 @@ class Menu {
$data = array();
echo $this->renderer->render('settings.html', $data);
}
function subscribers() {
$data = array();
echo $this->renderer->render('subscribers.html', $data);
}
}

View File

@ -6,12 +6,12 @@ class SettingsPageCest {
$I->login();
}
function iCanSeeTheSettingsPage(AcceptanceTester $I) {
function iCanSeeTheTitle(AcceptanceTester $I) {
$I->amOnPage('/wp-admin/admin.php?page=mailpoet-settings');
$I->see('Settings');
}
function iCanGoToSettingsFromWelcomePage(AcceptanceTester $I) {
function iCanReachItFromTheWelcomePage(AcceptanceTester $I) {
$I->amOnPage('/wp-admin/admin.php?page=mailpoet');
$I->see('Welcome!');
$I->click('Setup');

View File

@ -0,0 +1,16 @@
<?php
class SubscribersPageCest {
function _before(AcceptanceTester $I) {
$I->login();
}
function iCanSeeTheTitle(AcceptanceTester $I) {
$I->amOnPage('/wp-admin/admin.php?page=mailpoet-subscribers');
$I->see('Subscribers');
}
function _after(AcceptanceTester $I) {
}
}

View File

@ -6,7 +6,7 @@ class WelcomePageCest {
$I->login();
}
function iCanSeeTheWelcomePage(AcceptanceTester $I) {
function iCanSeeTheTitle(AcceptanceTester $I) {
$I->amOnPage('/wp-admin/admin.php?page=mailpoet');
$I->see('Welcome!');
}

26
views/subscribers.html Normal file
View File

@ -0,0 +1,26 @@
<% extends 'layout.html' %>
<% block content %>
<h1><%= 'Subscribers' %></h1>
<script type="text/javascript">
jQuery(function($) {
// dom loaded
$(function() {
MailPoet.Ajax.post({
endpoint: 'subscribers',
action: 'get',
data: {
first_name: 'John'
},
onSuccess: function(response) {
// console.log(response);
}
});
});
});
</script>
<% endblock %>