nbrabant / rpi-inventory

3 stars 3 forks source link

#25 tests #34

Closed dangenendt closed 2 years ago

dangenendt commented 2 years ago

Closes #25

Added some new tests

dangenendt commented 2 years ago

@nbrabant Did you ever faced this problem?! Added new tests and now in one of those tests the api returns error 500 because the sqlite not exists 🧐🧐. Im just doing db stuff like in the other tests

dangenendt commented 2 years ago

Ok, right after i wrote the comment before, i found the "RefreshDatabase"-Trait. WIth this one used in the CartTest, everything works. 😒

nbrabant commented 2 years ago

Hello and thanks for the contribution :) Yes, the problem isn't an unknow one for me, solved by the RefreshDatabase trait (see the \App\Domain\Cart\Tests\Feature\Services\CartCommandServiceTest)

dangenendt commented 2 years ago

@nbrabant you have been absolutely right. Could remove many things after adding the RefreshDatabase Trait.