spec/wally/search_features_spec.rb in wally-0.0.6 vs spec/wally/search_features_spec.rb in wally-0.0.7
- old
+ new
@@ -33,9 +33,16 @@
write_feature("sample1.feature", "Feature: Monkeys")
results = SearchFeatures.new(lists_features).find(:query => "mnkeys")
results.suggestion.should == "Monkeys"
end
+ it "has a suggestion only when it's different from the search query" do
+ write_feature("sample1.feature", "Feature: monkeys\nScenario: feature")
+ write_feature("sample2.feature", "Feature: dogs\nScenario: Sample scenario")
+ results = SearchFeatures.new(lists_features).find(:query => "feature")
+ results.suggestion.should be_nil
+ end
+
context "feature with multiple scenarios" do
before do
contents = <<-CONTENTS
Feature: Sample Feature
Scenario: Sample Scenario