@Povilas, test_guest_registers_to_activity()fails to send notification because User::find(1) is different to Test User. User #1 is a random user created by ActivityFactory, User #2 matches with Test User => test@test.com. So one way to fix this test would be to replace User::find(1) with User::find(2).
If that were the case, shouldn't any other test making use of the same route fail as well? For example the test case right above the one throwing the error, makes use of the same get(route(...)) call, and that test is passing just fine.
aritsan need fix it to artisan in this line:
php aritsan make:test RegisterActivityTest
@Povilas,
test_guest_registers_to_activity()fails to send notification becauseUser::find(1)is different toTest User. User #1 is a random user created byActivityFactory, User #2 matches withTest User=>test@test.com. So one way to fix this test would be to replaceUser::find(1)withUser::find(2).hye or Notification::assertSentTo(User::where('email', 'test@test.com')->first(), RegisteredToActivityNotification::class);
Thank you for this. It helped me to fix the last test.
This instruction helped me. Using
User::find(2)did not helped.Hi,
Test "test_shows_already_registered_when_user_is_registered_to_activity()" is failing with a large output, and the end message is:
The odd thing is that the previous test makes use of the same route without any issue, so it's proof that
works as intended;
You are missing a view.
View [activities.show] not foundIf that were the case, shouldn't any other test making use of the same route fail as well? For example the test case right above the one throwing the error, makes use of the same get(route(...)) call, and that test is passing just fine.
Not sure if you still have this error, but the view is called activity.show. Made the same mistake in my tests :)