Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use siloed classes in other tests.

  • Loading branch information...
commit 67ca14f9a5364f91c79829002038199ac9a84edd 1 parent 09a58b1
@benhamill benhamill authored
Showing with 5 additions and 7 deletions.
  1. +1 −1  Rakefile
  2. +4 −6 spec/texticle/full_text_indexer_spec.rb
View
2  Rakefile
@@ -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
View
10 spec/texticle/full_text_indexer_spec.rb
@@ -56,7 +56,6 @@ 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)
@@ -64,7 +63,7 @@ def self.root
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,7 +81,7 @@ def self.down
end
MIGRATION
- @indexer.generate_migration('WebComic')
+ @indexer.generate_migration('WebComicWithSearchableName')
assert_equal(expected_sql, @output.string)
end
@@ -90,7 +89,6 @@ def self.down
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)
@@ -98,7 +96,7 @@ def self.down
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
Please sign in to comment.
Something went wrong with that request. Please try again.