Skip to content

Commit

Permalink
activerecord specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bibendi committed Mar 12, 2013
1 parent b58f411 commit 8ae6cd9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions lib/sphinx_integration/extensions/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ def define_secondary_index(args = {}, &block)
}
end

def reset_indexes
self.sphinx_index_blocks = []
self.sphinx_indexes = []
self.sphinx_facets = []
self.defined_indexes = false
end

def rt_index_names
define_indexes
sphinx_indexes.collect(&:rt_name)
Expand Down
10 changes: 9 additions & 1 deletion spec/sphinx_integration/extensions/active_record_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# coding: utf-8
require 'spec_helper'

describe SphinxIntegration::Extensions::ActiveRecord do
describe 'ActiveRecord::Base extensions' do

describe '.max_matches' do
subject { Post.max_matches }
it { should be_a(Integer) }
it { should eq 5000 }
end

describe '.define_secondary_index' do

end

end

0 comments on commit 8ae6cd9

Please sign in to comment.