ciopte7 (2) [Avatar] Offline
#1
Here is a link to my github version of the ticketee app. https://github.com/ciopte7/ticket_tracker

I am having two separate issues with chapter 12, specifically getting the following specs to pass. In the gmail.feature file all of the steps pass except for the last one stating "Then there should be an email from Ticketee in my inbox". I will note that this actually does send an email to the account that I have linked it to. However I get the following error message instead of the feature passing:

deadlock; recursive locking (ThreadError)
<internal:prelude>:8:in `lock'
<internal:prelude>:8:in `synchronize'
./features/step_definitions/app_email.steps.rb:22:in `block (2 levels) in <top (required)>'
<internal:prelude>:10:in `synchronize'
./features/step_definitions/app_email.steps.rb:21:in `/^there should be an email from Ticketee in my inbox$/'
features/gmail.feature:33:in `Then there should be an email from Ticketee in my inbox'

Failing Scenarios:
cucumber features/gmail.feature:21 # Scenario: Receiving a real world email

The next issue that I am having has to do with receiving email, I have followed all of the steps required and I am still receiving this error that should have disappeared when I added "== ADD YOUR REPLY ABOVE THIS LINE ==" to the email template files.

1) Receiver parses a reply from a comment update into a comment
Failure/Error: lambda { Receiver.parse(mail) }.should(change(ticket.comments, :count).by(1))
count should have been changed by 1, but was changed by 0
# ./spec/mailers/receiver_spec.rb:14:in `block (2 levels) in <top (required)>'

Finished in 0.30982 seconds
1 example, 1 failure

Is there anything that I may have overlooked when going through typing out the application?
robmi (3) [Avatar] Offline
#2
Re: Chapter 12 Receiving and sending email
Hi,

I was able to get the features/gmail.feature to pass by patching the gmail gem according to the fix mentioned here:
https://github.com/nu7hatch/gmail/pull/28/files


The issue is described here:
https://github.com/nu7hatch/gmail/pull/28

Cheers
ryanbigg (423) [Avatar] Offline
#3
Re: Chapter 12 Receiving and sending email
Thanks for doing the research on that one robmi smilie I had encountered it in my testing of the book but I couldn't reproduce it on another machine when I was writing it, so I assumed it was a Me problem. Seems not to be the case.
ryanbigg (423) [Avatar] Offline
#4
Re: Chapter 12 Receiving and sending email
The second error seems to indicate that Receiver is not doing its job. Could you please validate that it is creating a new Comment record like it should?
ciopte7 (2) [Avatar] Offline
#5
Re: Chapter 12 Receiving and sending email
Hmmm, so I ran through this in development mode, and added two users to a sample ticket with some added comments, and the email sending feature worked fine. However when I ran through responding to an email above the line the application did not receive the incoming email.
jacquerie (3) [Avatar] Offline
#6
Re: Chapter 12 Receiving and sending email
For issue #2:

You might have overlooked that the code in Listing 12.15 is subtly different from the code on the previous page. Check that you are actually calling "default_part_body" instead of just "body" on "comment_email".

At least, that's the problem I just had while typing this code.