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
Simple captca for signup page #4659
Conversation
@@ -2,70 +2,77 @@ | |||
<div class="container"> | |||
|
|||
<div class="row"> | |||
<div class="span4" id="image-container"> |
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.
Most of the changes here are indentation fixes by @qmaruf - it is the official correct indentation unlike what it was before, but imho it's not a good idea to bundle random indentation fixes into a feature pull - opinions? :)
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 agree but editing those out now just increases the noise, so I'd say leave them in for now.
@qmaruf - I couldn't figure out how to change your commit author easily, sorry :P @MrZyx - test for the user model included - I think it actually verifies something ;) I couldn't think of anything to add to the controller test. There is no point in testing the captcha itself, in fact it auto-validates in test environment. If you have something in mind, please let me know. |
Nice work! |
Added missing Changelog entry |
AppConfig.settings.captcha.enable = true | ||
@user.sign_up.should be_true | ||
User.find_by_username("ohai").should == @user | ||
end |
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'd just make sure that the right methods are called:
@user.should_receive(:save_with_captcha).and_return(false)
and
@user.should_receive(:save).and_return(true)
Both are external dependencies and we assume they work correctly, we really just want to be sure that the right methods are called depending on the setting in case that gets more complex in the future.
…rite simple_captcha views to haml. Revert .rvmrc, fix indentation in config examp$
Fixed test according to comments and squashed to two commits |
Thank you both! |
Awesome guys ;) |
Thanks @qmaruf for working on this! |
Nice work both of you. Thanks so much for getting this done. |
Adopted pull request by @qmaruf (#4626) - this is to replace that to finish captcha functionality. I kept the original commits but squashed them into one. Also fixed a few minor things like indentation in config example, reverted .rvmrc change and locked the captcha gem version in dependencies.
Will add tests asap to finish this.