-
Notifications
You must be signed in to change notification settings - Fork 86
Refactor Category Controller Tests #429
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
Conversation
| conn |> put(path, payload) | ||
| end | ||
|
|
||
| test "lists all entries on index", %{conn: conn} do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this is missing describe "index" do
| category = Repo.get_by(Category, @valid_attrs) | ||
| assert category | ||
| assert response["data"]["id"] == "#{category.id}" | ||
| assert conn |> request_update(@valid_attrs) |> json_response(200) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the organization membership update test:
organization = insert(:organization)
membership = insert(:organization_membership, organization: organization, role: "pending")
insert(:organization_membership, organization: organization, member: current_user, role: "owner")
`assert conn |> request_update(membership, @valid_attrs) |> json_response(200)`
Should I change it to look more like this one? Looks like the request_update helper has a default_record.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, because you do need someone who's an organization admin to approve, right?
35bf7e0 to
de38021
Compare
|
@amyschools that commit message is a little unclear. |
de38021 to
e623364
Compare
e623364 to
7c35183
Compare
What's in this PR?
Add api_case.ex helper functions to Category controller tests.
References
Closes #427
Progress on: #413