-
Notifications
You must be signed in to change notification settings - Fork 71
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
Delete user if email isn't confirmable #366
base: main
Are you sure you want to change the base?
Conversation
Hey @mftaff - bummer the vagrant setup isn't working. We definitely need to have tests for this though. Once you push up a change to this pull request, it will run on Travis - so even if you can't run the tests locally, you can add a new test to the spec file and it will be tested on our CI - warning: this isn't the fastest way to do development, it's much better to get things running locally The place you need to add a spec is in spec/workers/email_confirmation_worker_spec.rb. The spec can stub raising the exception, it should test that when the exception is raised it deletes the user. |
👍 Cool cool. I just got rspec running locally. I am writing a test now. |
8c957f3
to
2c99f16
Compare
I am having a bit of trouble with creating the test. It seems that when in test mode, sidekiq isn't actually sending emails: I may have misunderstood what that link said, but it seems that when testing, the mailers are just being created, but not actually sent out. Do you know how to get around this? Some way to actually try and deliver (or test the emails validity) the email and this way we should be able to catch any SMTPSyntaxErrors. Here is what I have so far:
|
2c99f16
to
3c8a705
Compare
As an aside I just came up with |
Sorry for the slow response @mftaff ! I think checking that the error is raised is good. I think you could actually stub the delivery of the message and the raising of the error, since you're correct, the mailers don't actually deliver in testing. |
No worries! I have been trying to do exactly that - however, so far I haven't been successful. I haven't written tests for mailers before, so this is a bit new for me. Do you have an idea what this test needs to look like? |
fixes #130
Note: I am unable to test this solution because of the inability to setup locally using vagrant (see #353). However, it is a starting point, and I am happy to make any changes required :-)