# Testing emailers

**URL:** <https://www.ruby-forum.com/t/testing-emailers/183877>\
**Category:** Rails\
**Created:** [February 22, 2010, 8:28am UTC](https://www.ruby-forum.com/t/testing-emailers/183877 "2010-02-22T08:28:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [February 22, 2010, 8:28am UTC](https://www.ruby-forum.com/t/testing-emailers/183877/1 "2010-02-22T08:28:59Z")

</div>

Hello people,

I am testing the emailers. I am following this tutorial:-  
[http://izumi.plan99.net/manuals/testing\_rails\_applications-c17d65ba.html](http://izumi.plan99.net/manuals/testing_rails_applications-c17d65ba.html)

But i have got a problem. I have written the test case as like:-

def test\_check\_abc  
@expected = ‘MyMailer#signup’  
@expected.body = read\_fixture(‘signup’)  
@expected.date = Time.now

assert\_equal @expected.encoded,  
Emailer.create\_invite(‘removed\_email\_address@domain.invalid’, ‘removed\_email\_address@domain.invalid’,  
@expected.date).encoded  
end

Now i am getting problem as  
“NoMethodError: undefined method `leaverequest’ for Emailer:Class”…  
What is it …?

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [February 22, 2010, 12:06pm UTC](https://www.ruby-forum.com/t/testing-emailers/183877/2 "2010-02-22T12:06:24Z")

</div>

On Feb 22, 7:28 am, Hemant B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello people,
> 
> I am testing the emailers. I am following this tutorial:-[http://izumi.plan99.net/manuals/testing\_rails\_applications-c17d65ba.html](http://izumi.plan99.net/manuals/testing_rails_applications-c17d65ba.html)

There’s a more update version of that at

> **[Testing Rails Applications — Ruby on Rails Guides](https://guides.rubyonrails.org/testing.html#testing-your-mailers)**
>
> Testing Rails ApplicationsThis guide covers built-in mechanisms in Rails for testing your application.After reading this guide, you will know: Rails testing terminology. How to write unit, functional, integration, and system tests for your...

> end
> 
> Now i am getting problem as  
> “NoMethodError: undefined method `leaverequest’ for Emailer:Class”…  
> What is it …?

Probably an error in your Emailer class

Fred

---

<div class="post-metadata">

**Author:** ![hemantborole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/b782af/32.png) [@hemantborole](https://www.ruby-forum.com/u/hemantborole)\
**Post date:** [February 22, 2010, 12:12pm UTC](https://www.ruby-forum.com/t/testing-emailers/183877/3 "2010-02-22T12:12:08Z")

</div>

> > Now i am getting problem as  
> > “NoMethodError: undefined method `leaverequest’ for Emailer:Class”…  
> > What is it …?
> 
> Probably an error in your Emailer class

Hi Fred,

The thing was that we have to use deliver\_ with the method name. So i  
used and it delivers…
