Skip to content

Commit

Permalink
fix an error in the EventRepetition model test and remove two unusefu…
Browse files Browse the repository at this point in the history
…l date formatters
  • Loading branch information
davide-casiraghi committed Mar 29, 2020
1 parent c08f7b6 commit 1a42fa4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 47 deletions.
9 changes: 0 additions & 9 deletions resources/views/emails/user-activation-confirmation.blade.php

This file was deleted.

32 changes: 0 additions & 32 deletions resources/views/emails/user-activation.blade.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Models/EventRepetition.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public static function getFirstFutureEventRpDatesByEventId($eventId)
$ret = self::
select('start_repeat', 'end_repeat')
->where('event_id', $eventId)
->where('start_repeat', '>', Carbon::now()->format('Y-m-d'))
->where('start_repeat', '>', Carbon::now())
->first();

return $ret;
Expand Down Expand Up @@ -301,7 +301,7 @@ public static function getFirstEventRpIdByEventId($eventId): ?int
$firstFutureEventRpIdByEventId = self::
select('id')
->where('event_id', $eventId)
->where('start_repeat', '>', Carbon::now()->format('Y-m-d'))
->where('start_repeat', '>', Carbon::now())
->first();

if (! empty($firstFutureEventRpIdByEventId)) {
Expand Down
8 changes: 4 additions & 4 deletions tests/EventModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,16 +272,16 @@ public function it_gets_if_event_is_active()
// Event in the future
$attributes = factory(Event::class)->raw([
'title'=>'test title 1',
'startDate' => Carbon::now()->addDays(3)->format('d-m-Y'),
'endDate' => Carbon::now()->addDays(3)->format('d-m-Y'),
'startDate' => Carbon::now()->addDays(3)->format('Y-m-d'),
'endDate' => Carbon::now()->addDays(3)->format('Y-m-d'),
]);
$this->post('/events', $attributes);

// Event in the past
$attributes = factory(Event::class)->raw([
'title'=>'test title 2',
'startDate' => Carbon::now()->subDays(3)->format('d-m-Y'),
'endDate' => Carbon::now()->subDays(3)->format('d-m-Y'),
'startDate' => Carbon::now()->subDays(3)->format('Y-m-d'),
'endDate' => Carbon::now()->subDays(3)->format('Y-m-d'),
]);
$this->post('/events', $attributes);

Expand Down

0 comments on commit 1a42fa4

Please sign in to comment.