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

add tests to settings models/endpoints #21

Merged
merged 4 commits into from
Nov 7, 2016
Merged

add tests to settings models/endpoints #21

merged 4 commits into from
Nov 7, 2016

Conversation

riley
Copy link

@riley riley commented Nov 7, 2016

What does this PR do?

Adds test coverage to Setting model and corresponding endpoints.

How do I test this PR?

  • npm test
  • tests should pass

@coralproject/tech

.put('/api/v1/settings')
.send({moderation: 'post'}, (err, res) => {
expect(err).to.be.null;
expect(res).to.have.status(204);
Copy link

@jde jde Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be safer to return 200 with the settings object in the body? This way a fe could update it's state and ensure that what the user sees exactly reflects what's in the db.

This is a larger style question for our apis. Approving PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's what I had before, but @wyattjoh pointed out that it's more inline with REST to just return something along the lines of "it worked" instead of returning stuff from a PUT.

@riley riley merged commit 65a696d into master Nov 7, 2016
@riley riley deleted the settings-api-tests branch November 7, 2016 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants