Questions tagged [email-spec]
24 questions
20
votes
8 answers
rspec-email - How to get the body text?
I'm using rspec with the email-spec gem. I'm trying to do:
last_delivery = ActionMailer::Base.deliveries.last
last_delivery.body.should include "This is the text of the email"
But that doesn't work, is there a way to say body, text version?…

AnApprentice
- 108,152
- 195
- 629
- 1,012
16
votes
1 answer
How to write an RSpec for a Mail Interceptor?
I'm using a mail interceptor as follows:
setup_mail.rb
Mail.register_interceptor(MailInterceptor) if Rails.env != "production"
class MailInterceptor
class MailInterceptor
def self.delivering_email(message)
message.subject =…

AnApprentice
- 108,152
- 195
- 629
- 1,012
7
votes
4 answers
How to resend dropped emails in mailgun
How to resend dropped emails in mailgun?
I am using mailgun to send mails in my application,but some mails are dropped. Is there any method to resend the dropped mails?

Nandakumar R
- 93
- 1
- 4
4
votes
2 answers
How to test - with rspec - what template is used when creating an email? (Rails 3.0.7)
I'm trying to write some tests for emails generated with a mailer class using rspec and email_spec (Ruby on Rails 3.0.7)
I would like to check if the layout used for rendering the email is the layout that was specified in the mailer class.
Any idea…

Dorian
- 2,571
- 23
- 33
4
votes
2 answers
Email spec doesn't match body content in Rails
I'm using email_spec gem to test a simple email, but for some reason the body content appears to be empty:
1) ContactMailer welcome email to new user renders the body
Failure/Error: mail.should have_body_text("Hi")
expected the body to…

picardo
- 24,530
- 33
- 104
- 151
4
votes
6 answers
AWS SES handle doesn't exist mailbox with Lambda
I try to use AWS SES for handle some app data on get email.
I've verified mydomain.com with AWS SES. I want handle dynamic email to addresses 1@mydomain.com 2@mydoamin.com, where 1,2 id from database.
I want handle it with AWS lambda, but I can not…

VelikiiNehochuha
- 3,775
- 2
- 15
- 32
3
votes
1 answer
Cucumber/Capybara/Email Spec not working correctly with Selenium Driver
I've running some Cucumber/Capybara tests. I've been using the email_spec gem to check email stuff. Some steps where of the kind 'And "someone@email.com" should receive an email'. They give no problem when I run the test using the rack_test driver.…

sauronnikko
- 4,665
- 5
- 31
- 47
2
votes
2 answers
How do I test Pony emailing in a Sinatra app, using rspec?
I'm trying out email_spec, which says it supports Pony, but I'm not sure how I'd go about testing emails in a sinatra app. The examples in the readme show usages with rails ActionMailer, but not in Pony.
Not precious about using email_spec, so any…

zlog
- 3,316
- 4
- 42
- 82
2
votes
1 answer
Is there a way to follow a link based in its text in email_spec?
In RSpec I can easily follow the link corresponding to certain text using
click_link "change your password"
RSpec will then find the appropriate link and follow the associated HREF.
How do you do this in an email?
I'm trying to execute the same…

Peter Nixey
- 16,187
- 14
- 79
- 133
2
votes
1 answer
integration tests for devise password recovery using rspec, capybara and email_spec
I'm trying to test the password recovery using rspec/capybara using email_spec
My test.rb contains:
config.action_mailer.delivery_method = :test
My test goes like this:
feature User do
let!(:user){ FactoryGirl.build(:user) }
before(:each) do
…

Rimian
- 36,864
- 16
- 117
- 117
1
vote
1 answer
Email delivery testing with email_spec breaks on Rails 3.0.11 -> 3.1.3
I'm in process of migrating a rails 3.0.11 app to 3.1.3. And somehow, this breaks email_spec testing for amount of emails received when using cucumber + selenium setup.
config.action_mailer.delivery_method = :test, also have tried it with :cache and…

Toms Mikoss
- 9,097
- 10
- 29
- 41
1
vote
1 answer
How to do test integration of features based on delayed jobs with cucumber?
I want to test some features that needs delayed jobs to work, on cucumber. I have defined the following step:
Given /^jobs are being dispatched$/ do
Delayed::Worker.new.work_off
end
Right now, I am trying to test email notifications. So I have…

Amokrane Chentir
- 29,907
- 37
- 114
- 158
1
vote
3 answers
rspec email_spec and jobs.. how does it work? I want to check whether the letter was sent.. and maybe email body
I have 'controllers/users_controller.rb'
def create
user = User.new(person_params)
if user.save
EmailSendJob.perform_later(user.email, 'random_password')
end
end
I have 'mailers/user_mailer.rb'
def user_new(user_to, password)
…

Oleg Borodko
- 106
- 1
- 10
1
vote
1 answer
How to resolve a gem dependency conflict after installing email_spec
I just installed email-spec for use with rspec according to the instructions in the readme. Now, when I try to run a test (even without using email-spec's methods in my specs) I get this error:
$ rspec spec
Neither Pony nor ActionMailer appear to be…

jpalmieri
- 1,539
- 1
- 15
- 25
1
vote
1 answer
Capybara+rspec:Reset_Password routing error
So I am trying to test the simple feature of forgot password.I am newbie, so excuse me if its a silly question.
Here, I have to enter user email in forgot_password form which sends me a link in an email to reset password.
I am reaching inside the…

PriyankaK
- 925
- 2
- 10
- 18