Content&report test#9
Conversation
| report.setContent(content); | ||
| report.setReason(reason); | ||
|
|
||
| Report saved = reportRepository.save(report); |
There was a problem hiding this comment.
For the When steps, as you are testing the API to check if it can create reports, you should be using the API instead of directly creating the intance into de database.
| content.setName(name); | ||
| content.setDescription(description); | ||
|
|
||
| Content saved = contentRepository.save(content); |
There was a problem hiding this comment.
For the When steps, as you are testing the API to check if it can create Contents, you should be using the API instead of directly creating the intance into de database.
|
|
||
| Scenario: Create a new Content | ||
| Given there are no Contents in the system | ||
| And I login as "admin" with password "admin" |
There was a problem hiding this comment.
The problem is that the user admin with password admin doesn't exists. You need a background step (or a Given step before this one) that creates the user used for authentication. For isntance:
Given There is a registered user with username "user" and password "password" and email "user@sample.app"
| Assertions.assertEquals(0, contentRepository.count()); | ||
| } | ||
|
|
||
| @Given("^There is a registered user with username \"([^\"]*)\" and password \"([^\"]*)\" and email \"([^\"]*)\"$") |
There was a problem hiding this comment.
You don't need to reimplement this step; it is already implemented. Remove the implementation from here because now the issue is that it is detecting that the same step definition is implemented twice
No description provided.