Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Note the different port for the test environment.

  • Loading branch information...
commit 1688e84f92b7453dcd581e75be222f81d6cf3083 1 parent 2009d13
@pat pat authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 ts/en/testing.textile
View
13 ts/en/testing.textile
@@ -7,6 +7,13 @@ h2. Testing with Thinking Sphinx
Before you get caught up in the specifics of testing Thinking Sphinx using certain tools, it's worth noting that no matter what the approach, you'll need to turn off transactional fixtures and index your data after creating the appropriate records - otherwise you won't get any search results.
+Also: make sure you have your test environment using a different port number in @config/sphinx.yml@ - otherwise you won't be able to run Sphinx in your development environment _and_ your tests at the same time.
+
+{% highlight yaml %}
+test:
+ port: 9313
+{% endhighlight %}
+
<ul>
<li><a href="#unit_tests">Unit Tests and Specs</a></li>
<li><a href="#cucumber">Cucumber</a></li>
@@ -88,7 +95,7 @@ You can turn off transactional features on a per-test basis within the test clas
{% highlight ruby %}
class SearchControllerTest
self.use_transactional_fixtures = false
-
+
# ...
end
{% endhighlight %}
@@ -106,10 +113,10 @@ However, you probably don't want Sphinx running for your unit tests, and so it's
{% highlight ruby %}
test "Searching for Articles" do
ThinkingSphinx::Test.start
-
+
get :index
assert [@article], assigns[:articles]
-
+
ThinkingSphinx::Test.stop
end
{% endhighlight %}
Please sign in to comment.
Something went wrong with that request. Please try again.