Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write proper unit tests #129

Open
troccoli opened this issue Jun 28, 2020 · 0 comments
Open

Write proper unit tests #129

troccoli opened this issue Jun 28, 2020 · 0 comments
Assignees
Labels
unscheduled Issues that have not yet been put in a project

Comments

@troccoli
Copy link
Owner

Some of the unit tests are really integration tests as they rely on data to be created.

For example, Tests\Unit\Models\TeamTest::testItGetsTheFixtures relies on clubs and fixtures to be created. I understand this being a unit test for a model and this particular test actually testing the relationship between the Team and the Fixture models, it will be difficult to refactor. However we should have a look at all unit tests and write them as such. If it not possible, as it seems it is the case for Tests\Unit\Models\TeamTest::testItGetsTheFixtures, then the test should be moved in the Integration folder (or Feature folder, depending on #110).

We should also make sure we use Events::fake() in many of those tests so that when a model is created we don't fire the event (which we listen to to create roles and permissions).

@troccoli troccoli added the unscheduled Issues that have not yet been put in a project label Jun 28, 2020
@troccoli troccoli self-assigned this Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unscheduled Issues that have not yet been put in a project
Projects
None yet
Development

No branches or pull requests

1 participant