Skip to content
Prev Previous commit
Next Next commit
Fix issues in tests
  • Loading branch information
muglug committed Apr 17, 2018
commit c3af964304134b0ef3783643b87dea02a0018dfb
3 changes: 0 additions & 3 deletions tests/Api/Contact/ApiContactTagControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public function test_it_associates_tags_to_a_contact()

$response->assertJsonFragment([
'id' => $contact->id,
'name' => 'very-specific-tag-name',
'name' => 'very-specific-tag-name-2',
]);
}
Expand Down Expand Up @@ -140,7 +139,6 @@ public function test_it_removes_multiple_tags_from_a_contact()
]);

$response->assertJsonMissing([
'name' => $tag->name,
'name' => $tag2->name,
]);
}
Expand Down Expand Up @@ -170,7 +168,6 @@ public function test_it_removes_all_tags_from_a_contact()
$response->assertStatus(200);

$response->assertJsonMissing([
'name' => $tag->name,
'name' => $tag2->name,
]);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Browser/Settings/MultiFAControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MultiFAControllerTest extends DuskTestCase
public function cleanup()
{
exec('php artisan 2fa:deactivate --force --email=admin@admin.com', $output);
$this->log(implode($output));
//$this->log(implode($output));
}

/**
Expand Down
6 changes: 6 additions & 0 deletions tests/Feature/ActivityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public function test_user_can_add_an_activity()
'activity_id' => $latestActivity->id,
]);

$eventParams = [];

// Make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down Expand Up @@ -126,13 +128,17 @@ public function test_user_can_edit_an_activity()

$this->put('/activities/'.$activity->id.'/'.$contact->id, $params);

$newParams = [];

// see if the change is in the database
$newParams['account_id'] = $user->account_id;
$newParams['id'] = $activity->id;
$newParams['summary'] = 'this is another test';

$this->assertDatabaseHas('activities', $newParams);

$eventParams = [];

// make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down
8 changes: 8 additions & 0 deletions tests/Feature/CallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public function test_user_can_add_a_call_without_a_description()
$response->assertSee('Jan 01, 2013');
$response->assertSee('Last called: Jan 01, 2013');

$eventParams = [];

// Make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down Expand Up @@ -116,6 +118,8 @@ public function test_user_can_add_a_call_with_a_description()
$response->assertSee('Jan 01, 2013');
$response->assertSee('This is a test call');

$eventParams = [];

// Make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand All @@ -140,10 +144,14 @@ public function test_user_can_delete_a_call()
$response = $this->delete('/people/'.$contact->id.'/call/'.$call->id);
$response->assertStatus(302);

$params = [];

$params['id'] = $call->id;

$this->assertDatabaseMissing('calls', $params);

$eventParams = [];

// make sure no event is in the database about this object
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down
7 changes: 7 additions & 0 deletions tests/Feature/NoteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public function test_user_can_add_a_note()
'body' => $noteBody,
]);

$eventParams = [];

// Make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down Expand Up @@ -76,6 +78,8 @@ public function test_user_can_edit_a_note()
'body' => 'this is another test',
]);

$eventParams = [];

// make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand All @@ -98,10 +102,13 @@ public function test_user_can_delete_a_note()

$response = $this->delete('/people/'.$contact->id.'/notes/'.$note->id);

$params = [];
$params['id'] = $note->id;

$this->assertDatabaseMissing('notes', $params);

$eventParams = [];

// make sure no event is in the database about this object
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down
2 changes: 2 additions & 0 deletions tests/Feature/TaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public function test_user_can_add_a_task()

$this->assertDatabaseHas('tasks', $params);

$eventParams = [];

// Make sure an event has been created for this action
$eventParams['account_id'] = $user->account_id;
$eventParams['contact_id'] = $contact->id;
Expand Down