Added Subscribers empty page, with test.
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
|
16
tests/acceptance/SubscribersPageCest.php
Normal file
16
tests/acceptance/SubscribersPageCest.php
Normal 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) {
|
||||
}
|
||||
}
|
@ -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
26
views/subscribers.html
Normal 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 %>
|
Reference in New Issue
Block a user