# Mailer unit test bug

**URL:** <https://www.ruby-forum.com/t/mailer-unit-test-bug/104272>\
**Category:** Rails\
**Created:** [May 16, 2007, 7:35am UTC](https://www.ruby-forum.com/t/mailer-unit-test-bug/104272 "2007-05-16T07:35:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 16, 2007, 7:35am UTC](https://www.ruby-forum.com/t/mailer-unit-test-bug/104272/1 "2007-05-16T07:35:33Z")

</div>

how can it fail ,

Loaded suite test/unit/user\_notifier\_test  
Started  
F  
Finished in 0.491143 seconds.

1. Failure:  
test\_get\_new\_contact\_in\_my\_network(UserNotifierTest)  
[test/unit/user\_notifier\_test.rb:29]:

\<“Date: Wed, 16 May 2007 05:30:04 +0200\r\n  
From: removed\_email\_address@domain.invalid\r\n  
To: removed\_email\_address@domain.invalid\r\n  
Subject: test\r\nMime-Version: 1.0\r\n  
Content-Type: text/plain; charset=utf-8\r\n\r\n  
CLOSEUP - nice network\n\n  
test-content\n\n  
To join the network, click on the following link :\n\n  
[http://0.0.0.0:3000/account/activate/niceguy\n\n](http://0.0.0.0:3000/account/activate/niceguy%5Cn%5Cn)  
and enjoy.”\>.

expected but was

\<“Date: Wed, 16 May 2007 05:30:04 +0200\r\n  
From: removed\_email\_address@domain.invalid\r\n  
To: removed\_email\_address@domain.invalid\r\n  
Subject: test\r\nMime-Version: 1.0\r\n  
Content-Type: text/plain; charset=utf-8\r\n\r\n  
CLOSEUP - nice network\n\n  
test-content\n\n  
To join the network, click on the following link :\n\n  
[http://0.0.0.0:3000/account/activate/niceguy\n\n](http://0.0.0.0:3000/account/activate/niceguy%5Cn%5Cn)  
and enjoy.”\>.

1 tests, 1 assertions, 1 failures, 0 errors

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 16, 2007, 8:03am UTC](https://www.ruby-forum.com/t/mailer-unit-test-bug/104272/2 "2007-05-16T08:03:43Z")

</div>

Kad K. wrote:

> how can it fail ,
> 
> Loaded suite test/unit/user\_notifier\_test  
> Started  
> F  
> Finished in 0.491143 seconds.
> 
> 1. Failure:  
> test\_get\_new\_contact\_in\_my\_network(UserNotifierTest)  
> [test/unit/user\_notifier\_test.rb:29]:
> 
> \<“Date: Wed, 16 May 2007 05:30:04 +0200\r\n  
> From: removed\_email\_address@domain.invalid\r\n  
> To: removed\_email\_address@domain.invalid\r\n  
> Subject: test\r\nMime-Version: 1.0\r\n  
> Content-Type: text/plain; charset=utf-8\r\n\r\n  
> CLOSEUP - nice network\n\n  
> test-content\n\n  
> To join the network, click on the following link :\n\n  
> [http://0.0.0.0:3000/account/activate/niceguy\n\n](http://0.0.0.0:3000/account/activate/niceguy%5Cn%5Cn)  
> and enjoy.”\>.
> 
> expected but was
> 
> \<“Date: Wed, 16 May 2007 05:30:04 +0200\r\n  
> From: removed\_email\_address@domain.invalid\r\n  
> To: removed\_email\_address@domain.invalid\r\n  
> Subject: test\r\nMime-Version: 1.0\r\n  
> Content-Type: text/plain; charset=utf-8\r\n\r\n  
> CLOSEUP - nice network\n\n  
> test-content\n\n  
> To join the network, click on the following link :\n\n  
> [http://0.0.0.0:3000/account/activate/niceguy\n\n](http://0.0.0.0:3000/account/activate/niceguy%5Cn%5Cn)  
> and enjoy.”\>.
> 
> 1 tests, 1 assertions, 1 failures, 0 errors

It seems that only the from: is wrong… (tested all the other  
statements) but why ?

Loaded suite test/unit/user\_notifier\_test  
Started  
F  
Finished in 0.491175 seconds.

1. Failure:  
test\_get\_new\_contact\_in\_my\_network(UserNotifierTest)  
[test/unit/user\_notifier\_test.rb:32]:  
\<“removed\_email\_address@domain.invalid”\> expected but was  
\<“removed\_email\_address@domain.invalid”\>.

1 tests, 2 assertions, 1 failures, 0 errors

should we add a ‘binocular plugin’ into Rails to look twice ? ;-))
