# Writing database backed plugin tests

**URL:** <https://www.ruby-forum.com/t/writing-database-backed-plugin-tests/135173>\
**Category:** Rails\
**Created:** [April 18, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/writing-database-backed-plugin-tests/135173 "2008-04-18T19:33:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [April 18, 2008, 7:33pm UTC](https://www.ruby-forum.com/t/writing-database-backed-plugin-tests/135173/1 "2008-04-18T19:33:06Z")

</div>

I’m trying to write tests for a plugin that includes an active record  
model. This means that my plugin tests need to have access to a  
database, as well as a skeleton rails stack.

Is there any resources out there that show how to achieve this?

Thanks

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [April 18, 2008, 7:45pm UTC](https://www.ruby-forum.com/t/writing-database-backed-plugin-tests/135173/2 "2008-04-18T19:45:59Z")

</div>

On 18 Apr 2008, at 18:33, Alex W. wrote:

> I’m trying to write tests for a plugin that includes an active record  
> model. This means that my plugin tests need to have access to a  
> database, as well as a skeleton rails stack.
> 
> Is there any resources out there that show how to achieve this?

pluginaweek has a thing on that. unfortunately they seem to be down  
right now, but the google cached copy should sort you out:

[http://66.102.9.104/search?q=cache:l7hpl-xkv8sJ:www.pluginaweek.org/index.php%3Fs%3Dilib+plugin+test+rails\_root&hl=en&ct=clnk&cd=3&client=safari](http://66.102.9.104/search?q=cache:l7hpl-xkv8sJ:www.pluginaweek.org/index.php%3Fs%3Dilib+plugin+test+rails_root&hl=en&ct=clnk&cd=3&client=safari)

Fred

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [April 18, 2008, 10:09pm UTC](https://www.ruby-forum.com/t/writing-database-backed-plugin-tests/135173/3 "2008-04-18T22:09:21Z")

</div>

Frederick C. wrote:

> On 18 Apr 2008, at 18:33, Alex W. wrote:
> 
> > I’m trying to write tests for a plugin that includes an active record  
> > model. This means that my plugin tests need to have access to a  
> > database, as well as a skeleton rails stack.
> > 
> > Is there any resources out there that show how to achieve this?
> 
> pluginaweek has a thing on that. unfortunately they seem to be down  
> right now, but the google cached copy should sort you out:
> 
> [http://66.102.9.104/search?q=cache:l7hpl-xkv8sJ:www.pluginaweek.org/index.php%3Fs%3Dilib+plugin+test+rails\_root&hl=en&ct=clnk&cd=3&client=safari](http://66.102.9.104/search?q=cache:l7hpl-xkv8sJ:www.pluginaweek.org/index.php%3Fs%3Dilib+plugin+test+rails_root&hl=en&ct=clnk&cd=3&client=safari)
> 
> Fred

Google to the rescue.

Thanks for the link, that looks like just what I need.
