# Testing Environment for Plugints

**URL:** <https://www.ruby-forum.com/t/testing-environment-for-plugints/153914>\
**Category:** Rails\
**Created:** [November 22, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/testing-environment-for-plugints/153914 "2008-11-22T22:48:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@musk](https://www.ruby-forum.com/u/musk)\
**Post date:** [November 22, 2008, 10:48pm UTC](https://www.ruby-forum.com/t/testing-environment-for-plugints/153914/1 "2008-11-22T22:48:00Z")

</div>

Hello,

I’m currently creating my first plugin in rails. It creates a model  
and a mixin for controllers. For testing purposes I need a test  
controller (sort of a mock) to which I can include my mixin and test  
wether the mixed in methods work. My problem is in order to do this I  
either have to setup my test enviorment in a rails app outside of my  
plugin or I have to replicate a whole rails environment in my plugin  
so that the standard routing stuff and everything works.  
Is this the normal procedure or is there an easier way?  
I searched the group and made a search on the net but I have not found  
a satisfactory answer yet. Any help is greatly appreciated.

Regards  
musk

---

<div class="post-metadata">

**Author:** ![musk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@musk](https://www.ruby-forum.com/u/musk)\
**Post date:** [November 22, 2008, 10:52pm UTC](https://www.ruby-forum.com/t/testing-environment-for-plugints/153914/2 "2008-11-22T22:52:06Z")

</div>

On Nov 22, 9:26 pm, musk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I searched the group and made a search on the net but I have not found  
> a satisfactory answer yet. Any help is greatly appreciated.

In the past i’ve done the whole fake up a whole rails environment  
thing, but you can also do stuff like  
[http://www.alexyoung.org/articles/show/44/rails\_plugin\_testing\_guide](http://www.alexyoung.org/articles/show/44/rails_plugin_testing_guide)

Fred
