# Writing database backed plugin tests.

**URL:** <https://discuss.rubyonrails.org/t/writing-database-backed-plugin-tests/28214>\
**Category:** rubyonrails-talk\
**Created:** [April 18, 2008, 5:33pm UTC](https://discuss.rubyonrails.org/t/writing-database-backed-plugin-tests/28214 "2008-04-18T17:33:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 18, 2008, 5:33pm UTC](https://discuss.rubyonrails.org/t/writing-database-backed-plugin-tests/28214/1 "2008-04-18T17: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:** ![Frederick\_Cheung](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/frederick_cheung/32/3901_2.png) [@Frederick\_Cheung](https://discuss.rubyonrails.org/u/Frederick_Cheung)\
**Post date:** [April 18, 2008, 5:44pm UTC](https://discuss.rubyonrails.org/t/writing-database-backed-plugin-tests/28214/2 "2008-04-18T17:44:43Z")

</div>

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:** ![11175](https://avatars.discourse-cdn.com/v4/letter/1/8edcca/32.png) [@11175](https://discuss.rubyonrails.org/u/11175)\
**Post date:** [April 18, 2008, 8:09pm UTC](https://discuss.rubyonrails.org/t/writing-database-backed-plugin-tests/28214/3 "2008-04-18T20:09:21Z")

</div>

Frederick Cheung wrote:
