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 functionality for activating/deactivating users in the users list #27

Closed
wants to merge 2 commits into from

Conversation

Serneum
Copy link
Member

@Serneum Serneum commented Nov 16, 2016

Closes #25

@Serneum Serneum force-pushed the feature/toggle-user-active branch from 5599124 to 541e01b Compare November 16, 2016 01:10
@mbramson mbramson force-pushed the feature/toggle-user-active branch from 541e01b to 7275b50 Compare November 16, 2016 02:16

conn = get conn, user_path(conn, :index)
assert html_response(conn, 200) =~ "Inactive"
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that these tests are testing too many things at once. You've even left whitespace where these tests should probably be broken out.


def deactivate(conn, %{"user_id" => id}) do
update_user(conn, id, %{active: false}, :index)
end
Copy link
Contributor

Choose a reason for hiding this comment

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

We should definitely explore ways to accomplish this without adding new non-RESTful controller methods, as discussed.

@Serneum
Copy link
Member Author

Serneum commented Nov 19, 2016

@mbramson Commit one isn't RESTful, but cleaner in my opinion. Commit two is the more RESTful but I hate it. Tell me which you'd prefer.

@Serneum Serneum force-pushed the feature/toggle-user-active branch from d855acb to 2a9934d Compare November 19, 2016 20:08
resources "/users", UserController
resources "/users", UserController do
put "/activate", UserController, :activate, as: :activate
put "/deactivate", UserController, :deactivate, as: :deactivate
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to follow RESTful type behavior. Why are 'activate' and 'deactivate' their own routes here?

@mbramson
Copy link
Contributor

mbramson commented Feb 3, 2017

Closing in favor of #85, since the /users route no longer exists. That issue is a great opportunity to introduce react into this project.

@mbramson mbramson closed this Feb 3, 2017
@ericworkman ericworkman deleted the feature/toggle-user-active branch March 6, 2017 21:27
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.

3 participants