public
Fork of look/acts_as_solr
Description: This plugin adds full text search capabilities and many other nifty features from Apache‘s Solr to any Rails model. I'm currently rearranging the test suite to include a real unit test suite, and adding a few features I need myself.
Homepage: http://mattmatt.github.com/acts_as_solr
Clone URL: git://github.com/mattmatt/acts_as_solr.git
acts_as_solr / TESTING_THE_PLUGIN
100644 26 lines (16 sloc) 1.169 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
acts_as_solr comes with a quick and fast unit test suite, and with a longer-running
functional test suite, the latter testing the actual integration with Solr.
 
The unit test suite is written using Shoulda, so make sure you have a recent version
installed.
 
Running `rake test` or just `rake` will run both test suites. Use `rake test:unit` to
just run the unit test suite.
 
== How to run functional tests for this plugin:
To run the acts_as_solr's plugin tests run the following steps:
 
- create a MySQL database called "actsassolr_test" (if you want to use MySQL)
 
- create a new Rails project, if needed (the plugin can only be tested from within a Rails project); move/checkout acts_as_solr into its vendor/plugins/, as usual
 
- copy vendor/plugins/acts_as_solr/config/solr.yml to config/ (the Rails config folder)
 
- rake solr:start RAILS_ENV=test
 
- rake test:functional (Accepts the following arguments: DB=sqlite|mysql and MYSQL_USER=user)
 
== Troubleshooting:
If for some reason the tests don't run and you get MySQL errors, make sure you edit the MYSQL_USER entry under
config/environment.rb. It's recommended to create or use a MySQL user with no password.