Optimized Bulk actions

- Updated SQL schema for every created_at column so that it has a default value
- Updated unit tests based on recent changes (new methods in SubscriberSegment model)
- Added check for HelpScout initialization code so that it doesn't throw errors
This commit is contained in:
Jonathan Labreuille
2016-05-27 10:49:34 +02:00
parent 4a4c4e093a
commit 3c46a5b434
10 changed files with 288 additions and 244 deletions

View File

@@ -223,7 +223,7 @@ class SubscriberSegmentTest extends MailPoetTest {
expect($subscribed_segments[0]['name'])->equals($this->wp_segment->name);
}
function testItCanDeleteSubscriptionToWPSegment() {
function testItCannotDeleteSubscriptionToWPSegment() {
// subscribe to a segment and the WP segment
$result = SubscriberSegment::subscribeToSegments($this->subscriber, array(
$this->segment_1->id,
@@ -235,11 +235,10 @@ class SubscriberSegmentTest extends MailPoetTest {
$result = SubscriberSegment::deleteSubscriptions($this->subscriber);
expect($result)->true();
// it should have removed all subscriptions (even to the WP segment)
$subscriptions_count = SubscriberSegment::where(
'subscriber_id', $this->subscriber->id
)->count();
expect($subscriptions_count)->equals(0);
// the subscriber should still be subscribed to the WP segment
$subscribed_segments = $this->subscriber->segments()->findArray();
expect($subscribed_segments)->count(1);
expect($subscribed_segments[0]['name'])->equals($this->wp_segment->name);
}
function _after() {