spec/unit/thinking_sphinx/attribute_spec.rb in freelancing-god-thinking-sphinx-0.9.8 vs spec/unit/thinking_sphinx/attribute_spec.rb in freelancing-god-thinking-sphinx-0.9.10
- old
+ new
@@ -15,11 +15,11 @@
end
end
describe "to_select_sql method with MySQL" do
before :each do
- @index = Person.indexes.first
+ @index = Person.sphinx_indexes.first
@index.link!
end
it "should concat with spaces if there's more than one non-integer column" do
@index.attributes[0].to_select_sql.should match(/CONCAT_WS\(' ', /)
@@ -50,11 +50,11 @@
end
end
describe "to_select_sql method with PostgreSQL" do
before :each do
- @index = Person.indexes.first
+ @index = Person.sphinx_indexes.first
Person.connection.class.stub_method(
:name => "ActiveRecord::ConnectionAdapters::PostgreSQLAdapter"
)
@index.link!
end
@@ -197,11 +197,15 @@
@attribute.model = Person
@first_join = Object.stub_instance(:aliased_table_name => "tabular")
@second_join = Object.stub_instance(:aliased_table_name => "data")
- @first_assoc = ThinkingSphinx::Association.stub_instance(:join => @first_join)
- @second_assoc = ThinkingSphinx::Association.stub_instance(:join => @second_join)
+ @first_assoc = ThinkingSphinx::Association.stub_instance(
+ :join => @first_join, :has_column? => true
+ )
+ @second_assoc = ThinkingSphinx::Association.stub_instance(
+ :join => @second_join, :has_column? => true
+ )
end
it "should return the column name if the column is a string" do
@attribute.columns = [ThinkingSphinx::Index::FauxColumn.new("string")]
@attribute.send(:column_with_prefix, @attribute.columns.first).should == "string"
\ No newline at end of file