spec/lib/indexes/index_indexed_spec.rb in picky-3.0.0.pre1 vs spec/lib/indexes/index_indexed_spec.rb in picky-3.0.0.pre2

- old
+ new

@@ -2,11 +2,11 @@ describe Picky::Indexes::Index do context 'without stubbed categories' do before(:each) do - @index = described_class.new :some_index_name, source: [] + @index = described_class.new :some_index_name end describe 'define_category' do it 'adds a new category to the categories' do @index.define_category :some_category_name @@ -21,11 +21,11 @@ context "with stubbed categories" do before(:each) do @categories = stub :categories - @index = described_class.new :some_name, source: [] + @index = described_class.new :some_name @index.define_category :some_category_name1 @index.define_category :some_category_name2 @index.stub! :categories => @categories end @@ -44,12 +44,34 @@ @index.possible_combinations :some_token end end end + context 'result_identifier' do + context 'with it set' do + let(:index) do + described_class.new :some_name do + result_identifier :some_identifier + end + end + it 'has an after_indexing set' do + index.result_identifier.should == :some_identifier + end + end + context 'with it not set' do + let(:index) do + described_class.new :some_name do + end + end + it 'returns the name' do + index.result_identifier.should == :some_name + end + end + end + context "no categories" do it "works" do - described_class.new :some_name, source: [] + described_class.new :some_name end end end \ No newline at end of file