More Unit Tests + Initializer fix

- added unit test for Router\Forms
- updated unit test for Model\Segment to reflect changes
This commit is contained in:
Jonathan Labreuille
2016-02-02 17:22:11 +01:00
parent 24ecc879d3
commit a2ef62302f
10 changed files with 213 additions and 33 deletions

View File

@ -65,6 +65,8 @@ class Widget extends \WP_Widget {
)
);
$form_edit_url = admin_url('admin.php?page=mailpoet-form-editor&id=');
// set title
$title = isset($instance['title']) ? strip_tags($instance['title']) : '';
@ -102,8 +104,9 @@ class Widget extends \WP_Widget {
endpoint: 'forms',
action: 'create'
}).done(function(response) {
if(response !== false) {
window.location = response;
if(response.result && response.form_id) {
window.location =
"<?php echo $form_edit_url; ?>" + response.form_id;
}
});
return false;