Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.
If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!
You don't really need to know anything in advance in order to tackle this issue. However, a little understanding about Ruby and how TDD (specifically functional tests) work.
Get started with Ruby:
Currently, the mailer component does not test if the user who created a question is notified of proposed answers. In order to fix that, one needs to add a few more assertions.
https://github.com/publiclab/plots2/blob/master/test/functional/answers_controller_test.rb#L12-L16 lines post the answer. It is during this phase that the user needs to be notified. In order to check if the above lines trigger such a behaviour, wrap them in the following assertion:
assert_difference 'ActionMailer::Base.deliveries.size', 1 do
# create the answer here
end
This would ensure that some notification is sent. But is it sent to the author?
We'd want to do:
assert_equal node(:question).author.email, ActionMailer::Base.deliveries.last.to
Just after the other check.
Please email the developers list (see https://publiclab.org/developers) if you have questions!
Hi, I would like to work on this issue
@djmgit Sure, feel free to ask in case you need any help.
@djmit are you still working on this issue.
I also wanted to give it a try!
@shardulparab97 yeah I am still working on it, will be sending a PR soon (was busy with some other stuff) :)
Shardul - do check out this page for other issues you can work on --
including the "fto-candidate" ones:
https://github.com/publiclab/plots2/projects/2?fullscreen=true
Thank you!
On Tue, Feb 7, 2017 at 12:01 PM, Deepjyoti Mondal notifications@github.com
wrote:
@shardulparab97 https://github.com/shardulparab97 yeah I am still
working on it, will be sending a PR soon (was busy with some other stuff) :)—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/1198#issuecomment-278065583,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJ7HPPA9yznKNp47lMmxhJqh2-ur2ks5raKN_gaJpZM4LpdNl
.
Hi, @djmgit -- just checking if you've gotten stuck on this at all, or if I could help in any way? Thanks! If you push up a PR, it's helpful to see even if it's not complete, and we may be able to offer input.
@jywarren Does this problem still need fixing? I'm looking to get into open source work and I could put in a PR over the next day if this issue still needs fixing.
I think @djmgit is still working on it in #1237, but there are a lot of other issues we'd be very grateful for your help on:
https://github.com/publiclab/plots2/issues?q=is%3Aissue+is%3Aopen+label%3Afto-candidate
Hi, @jbkimble - I just asked @djmgit if they're still working on this, but if they're not (or don't respond for a day or two), and you're interested, you could start with their pull request in #1237 and work from there. I've left some comments on next steps there.
Hi, I also want to work on this issue. Can I ?
@MayankKashyap You definitely can, in case @jbkimble does not (and @djmgit as well) respond to it, and it might take some time. Meanwhile, you can try any other of our first-timers-only issues (if it's your first time contributing to open source software) or dive into one of the help-wanted issues otherwise. Thanks :)
OK @ryzokuken
Hi, I am a new contributor so please forgive if I have made a silly mistake in my debugging here.
I tried to implement the solution given but couldn't get the test to pass. Upon further investigation, I think the reason it didn't pass was that on this line in answer model, the current_user and the author are the same.
The if condition returns false and no email is sent out.
A possible solution:
Since the email is to be delivered to the question' author and not the answer's author, replace this line
@answer.answer_notify(current_user)
to
@answer.answer_notify(@node.author)
and then I can write a test accordingly.
@Khamba -- I think you're right that the author of the question and not of the answer should be notified, especially if the trigger is that the answer is posted -- then the author of the answer certainly knows that they are posting something, and don't need a notification.
Can you create a pull request with your solution? Is it based on #1237 -- which is a partial solution already?
Yes, I will get start working on a solution and submit a pull request. Thank you.
Most helpful comment
Hi, I would like to work on this issue