Permalink
Browse files

Use siloed classes in other tests.

  • Loading branch information...
1 parent 09a58b1 commit 67ca14f9a5364f91c79829002038199ac9a84edd @benhamill benhamill committed Jul 8, 2012
Showing with 5 additions and 7 deletions.
  1. +1 −1 Rakefile
  2. +4 −6 spec/texticle/full_text_indexer_spec.rb
View
@@ -74,7 +74,7 @@ end
task :test do
# require 'texticle_spec'
require 'texticle/searchable_spec'
- # require 'texticle/full_text_indexer_spec'
+ require 'texticle/full_text_indexer_spec'
end
namespace :db do
@@ -56,15 +56,14 @@ def self.root
context "when we've listed one specific field in a Searchable call" do
setup do
- WebComic.extend Searchable(:name)
@indexer = Texticle::FullTextIndexer.new
@output = StringIO.new
@indexer.instance_variable_set(:@output_stream, @output)
end
should "generate the right sql" do
expected_sql = <<-MIGRATION
-class WebComicFullTextSearch < ActiveRecord::Migration
+class WebComicWithSearchableNameFullTextSearch < ActiveRecord::Migration
def self.up
execute(<<-SQL.strip)
DROP index IF EXISTS web_comics_name_fts_idx;
@@ -82,23 +81,22 @@ def self.down
end
MIGRATION
- @indexer.generate_migration('WebComic')
+ @indexer.generate_migration('WebComicWithSearchableName')
assert_equal(expected_sql, @output.string)
end
end
context "when we've listed two specific fields in a Searchable call" do
setup do
- WebComic.extend Searchable(:name, :author)
@indexer = Texticle::FullTextIndexer.new
@output = StringIO.new
@indexer.instance_variable_set(:@output_stream, @output)
end
should "generate the right sql" do
expected_sql = <<-MIGRATION
-class WebComicFullTextSearch < ActiveRecord::Migration
+class WebComicWithSearchableNameAndAuthorFullTextSearch < ActiveRecord::Migration
def self.up
execute(<<-SQL.strip)
DROP index IF EXISTS web_comics_name_fts_idx;
@@ -121,7 +119,7 @@ def self.down
end
MIGRATION
- @indexer.generate_migration('WebComic')
+ @indexer.generate_migration('WebComicWithSearchableNameAndAuthor')
assert_equal(expected_sql, @output.string)
end

0 comments on commit 67ca14f

Please sign in to comment.