# RESTful Authentication Plug Tests

**URL:** <https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045>\
**Category:** Rails\
**Created:** [June 28, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045 "2007-06-28T18:01:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [June 28, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/1 "2007-06-28T18:01:54Z")

</div>

Hi all,

Is there a dependency for the RESTful Authentication plugin to make  
the test cases pass? I get a number of errors on a brand new Rails  
project with only the RESTful plugin installed. I’ve moved the bits  
of code around as instructed after running the generator script for  
the plugin.

Here’s an example:

1. Error:  
test\_should\_create\_user(UserTest):  
NoMethodError: undefined method `assert_difference' for #<UserTest: 0x327b73c> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/test_process.rb:452:in`method\_missing’  
./test/unit/user\_test.rb:7:in `test\_should\_create\_user’

Apparently assert\_difference/assert\_no\_difference is not included in  
the Rails 1.2.3 framework.

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [June 28, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/2 "2007-06-28T18:31:56Z")

</div>

On 6/28/07, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,
> 
> Is there a dependency for the RESTful Authentication plugin to make  
> the test cases pass? I get a number of errors on a brand new Rails  
> project with only the RESTful plugin installed. I’ve moved the bits  
> of code around as instructed after running the generator script for  
> the plugin.

It generates an authenticated test helper file that you can include in  
your unit tests. It should be included for you in the test cases that  
restful authentication generates:

[http://svn.techno-weenie.net/projects/plugins/restful\_authentication/generators/authenticated/templates/model\_functional\_test.rb](http://svn.techno-weenie.net/projects/plugins/restful_authentication/generators/authenticated/templates/model_functional_test.rb)

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [June 29, 2007, 5:46am UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/3 "2007-06-29T05:46:24Z")

</div>

On 6/28/07, Robert W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank for you quick reply Rick, however, after further experimentation  
> I still get the same failures when running test. I’ve also searched  
> and dug through all the code I could find and nothing I see implements  
> the assert\_difference and assert\_no\_difference methods. I have  
> included all the relevant test output here:

Oh, the plugin was updated for edge just a few days ago. You can just  
use an old revision if you want.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [July 13, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/4 "2007-07-13T16:30:45Z")

</div>

On Jun 29, 4:45 am, “Rick O.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Oh, the plugin was updated for edge just a few days ago. You can just  
> use an old revision if you want.

I keep forgetting that a lot of development is going on against Edge -  
this problem has tripped me up as well.

Please could you recommend a revision to use against 1.2.3 ?

Many thanks,

Kee

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [July 18, 2007, 11:05am UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/5 "2007-07-18T11:05:08Z")

</div>

> Oh, the plugin was updated for edge just a few days ago. You can just  
> use an old revision if you want.

Hello, I’ve encountered the same problem as Robert. Is reverting back  
to an old revision a short-term solution? And if so, does that mean  
these two functions will be replaced with something else in the  
future? Thanks.

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [June 29, 2007, 5:09am UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/6 "2007-06-29T05:09:23Z")

</div>

Thank for you quick reply Rick, however, after further experimentation  
I still get the same failures when running test. I’ve also searched  
and dug through all the code I could find and nothing I see implements  
the assert\_difference and assert\_no\_difference methods. I have  
included all the relevant test output here:

… robertwalker$ rake test:units  
…  
/usr/local/bin/ruby -Ilib:test “/usr/local/lib/ruby/gems/1.8/gems/  
rake-0.7.3/lib/rake/rake\_test\_loader.rb” “test/unit/  
user\_notifier\_test.rb” “test/unit/user\_test.rb”  
Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake/  
rake\_test\_loader  
Started  
…E…EEEE…  
Finished in 0.091025 seconds.

1. Error:  
test\_should\_create\_user(UserTest):  
NoMethodError: undefined method `assert_difference' for #<UserTest: 0x3278424> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/test_process.rb:452:in`method\_missing’  
./test/unit/user\_test.rb:10:in `test\_should\_create\_user’

2. Error:  
test\_should\_require\_email(UserTest):  
NoMethodError: undefined method `assert_no_difference' for #<UserTest: 0x327835c> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/ action_controller/test_process.rb:452:in`method\_missing’  
./test/unit/user\_test.rb:38:in `test\_should\_require\_email’

…  
…

14 tests, 16 assertions, 0 failures, 5 errors

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [July 18, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/7 "2007-07-18T14:30:48Z")

</div>

> Hello, I’ve encountered the same problem as Robert. Is reverting back  
> to an old revision a short-term solution? And if so, does that mean  
> these two functions will be replaced with something else in the  
> future? Thanks.

They’re in edge rails.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [August 5, 2007, 5:39pm UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/8 "2007-08-05T17:39:15Z")

</div>

On Jul 18, 11:49 am, Kim S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have worked around the problem by picking up the files  
> activesupport/lib/active\_support/core\_ext/test.rb and  
> activesupport/lib/active\_support/core\_ext/test/difference.rb  
> from edge rails and placing them in the version 1.2.3 rails  
> that I am using for my apps.

This workaround worked nicely for me.

---

<div class="post-metadata">

**Author:** ![rlwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecccb3/32.png) [@rlwinter](https://www.ruby-forum.com/u/rlwinter)\
**Post date:** [July 19, 2007, 1:25am UTC](https://www.ruby-forum.com/t/restful-authentication-plug-tests/108045/9 "2007-07-19T01:25:55Z")

</div>

On Jul 18, 2007, at 6:29 AM, Rick O. wrote:

> > Hello, I’ve encountered the same problem as Robert. Is reverting back  
> > to an old revision a short-term solution? And if so, does that mean  
> > these two functions will be replaced with something else in the  
> > future? Thanks.
> 
> They’re in edge rails.

I have worked around the problem by picking up the files  
activesupport/lib/active\_support/core\_ext/test.rb and  
activesupport/lib/active\_support/core\_ext/test/difference.rb  
from edge rails and placing them in the version 1.2.3 rails  
that I am using for my apps.

## Kim

Kim S. - principal, Shrier and Deihl - [mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Remote Unix Network Admin, Security, Internet Software Development  
Tinker Internet Services - Superior FreeBSD-based Web Hosting  
[http://www.tinker.com/](http://www.tinker.com/)
