forked from jfahrenkrug/radiant-xapian-search-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuration of searchable classes
- Loading branch information
Josh French
committed
Aug 8, 2010
1 parent
bedef0f
commit d8cdc56
Showing
9 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module SphinxSearch | ||
mattr_accessor :param_name, :content_length | ||
mattr_accessor :param_name, :content_length, :hidden_classes | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
describe Page do | ||
describe "Page.searchable" do | ||
it "should add itself to the hidden classes array" do | ||
SphinxSearch.hidden_classes = [] | ||
FileNotFoundPage.searchable false | ||
SphinxSearch.hidden_classes.should include('FileNotFoundPage') | ||
end | ||
|
||
it "should remove itself from the hidden classes array" do | ||
SphinxSearch.hidden_classes = %w(FileNotFoundPage) | ||
FileNotFoundPage.searchable true | ||
SphinxSearch.hidden_classes.should_not include("FileNotFoundPage") | ||
end | ||
end | ||
|
||
describe "#thinking_sphinx_options" do | ||
it "should description" do | ||
SphinxSearch.hidden_classes = %w(FileNotFoundPage) | ||
opts = SearchPage.new.send :thinking_sphinx_options, nil | ||
opts[:without][:class_crc].should include('FileNotFoundPage'.to_crc32) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters