wally 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@ Feature: Search features
11
11
  """
12
12
  And I am on the search page
13
13
  When I search for "<query>"
14
- Then I should see a link to "<feature name>" with the url "<url>"
14
+ Then I should see a search result link to "<feature name>" with the url "<url>"
15
15
 
16
16
  Examples:
17
17
  | query | feature name | url |
@@ -19,6 +19,18 @@ Feature: Search features
19
19
  | sAmPlE | Sample Feature |/features/sample-feature |
20
20
  | @QA | Sample Feature |/features/sample-feature |
21
21
 
22
+ Scenario: Search feature narrative
23
+ Given a feature file named "sample.feature" with the contents:
24
+ """
25
+ Feature: Sample Feature
26
+ In order to bla bla bla
27
+ As donkey
28
+ I want ermm I dunno.
29
+ """
30
+ And I am on the search page
31
+ When I search for "donkey"
32
+ Then I should see a search result link to "Sample Feature" with the url "/features/sample-feature"
33
+
22
34
  Scenario: Search scenario name
23
35
  Given a feature file named "sample.feature" with the contents:
24
36
  """
@@ -27,7 +39,7 @@ Feature: Search features
27
39
  """
28
40
  And I am on the search page
29
41
  When I search for "Sample Scenario"
30
- Then I should see a link to "Sample Scenario" with the url "/features/sample-feature/scenario/sample-scenario"
42
+ Then I should see a search result link to "Sample Scenario" with the url "/features/sample-feature/scenario/sample-scenario"
31
43
 
32
44
  Scenario: Search scenario steps
33
45
  Given a feature file named "sample.feature" with the contents:
@@ -38,7 +50,7 @@ Feature: Search features
38
50
  """
39
51
  And I am on the search page
40
52
  When I search for "I do something"
41
- Then I should see a link to "Sample Scenario" with the url "/features/sample-feature/scenario/sample-scenario"
53
+ Then I should see a search result link to "Sample Scenario" with the url "/features/sample-feature/scenario/sample-scenario"
42
54
 
43
55
  Scenario: Search suggests other searches
44
56
  Given a feature file named "sample.feature" with the contents:
@@ -48,4 +60,4 @@ Feature: Search features
48
60
  And I am on the search page
49
61
  When I search for "btman"
50
62
  Then I should see "Did you mean"
51
- And I should see a link to "Batman" with the url "/search?q=Batman"
63
+ And I should see a search result link to "Batman" with the url "/search?q=Batman"
@@ -6,3 +6,9 @@ When /^I search for "([^"]*)"$/ do |text|
6
6
  fill_in 'q', :with => text
7
7
  click_button 'Search'
8
8
  end
9
+
10
+ Then /^I should see a search result link to "([^"]*)" with the url "([^"]*)"$/ do |text, url|
11
+ within ".content" do
12
+ page.should have_link text, :href => url
13
+ end
14
+ end
@@ -14,6 +14,9 @@ module Wally
14
14
  if feature["tags"]
15
15
  feature_text += " " + feature["tags"].map { |tag| tag["name"] }.join(" ")
16
16
  end
17
+ if feature["description"]
18
+ feature_text += " " + feature["description"]
19
+ end
17
20
  feature_data = OpenStruct.new
18
21
  feature_data.feature = feature
19
22
  feature_data.text = feature_text
data/lib/wally/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wally
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -29,6 +29,13 @@ module Wally
29
29
  results.items.first.feature["name"].should == "Meh"
30
30
  end
31
31
 
32
+ it "finds features by narrative" do
33
+ write_feature("sample1.feature", "Feature: bla\nIn order to bananas")
34
+ results = SearchFeatures.new(lists_features).find(:query => "bananas")
35
+ results.items.size.should == 1
36
+ results.items.first.feature["name"].should == "bla"
37
+ end
38
+
32
39
  it "has a suggestion" do
33
40
  write_feature("sample1.feature", "Feature: Monkeys")
34
41
  results = SearchFeatures.new(lists_features).find(:query => "mnkeys")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wally
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-23 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
16
- requirement: &70362806161460 !ruby/object:Gem::Requirement
16
+ requirement: &70246414388060 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70362806161460
24
+ version_requirements: *70246414388060
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: haml
27
- requirement: &70362806160900 !ruby/object:Gem::Requirement
27
+ requirement: &70246414387640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70362806160900
35
+ version_requirements: *70246414387640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rdiscount
38
- requirement: &70362806160260 !ruby/object:Gem::Requirement
38
+ requirement: &70246414387220 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70362806160260
46
+ version_requirements: *70246414387220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: gherkin
49
- requirement: &70362806159620 !ruby/object:Gem::Requirement
49
+ requirement: &70246414386800 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70362806159620
57
+ version_requirements: *70246414386800
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: komainu
60
- requirement: &70362806159200 !ruby/object:Gem::Requirement
60
+ requirement: &70246414386380 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70362806159200
68
+ version_requirements: *70246414386380
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cucumber
71
- requirement: &70362806158780 !ruby/object:Gem::Requirement
71
+ requirement: &70246414385940 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70362806158780
79
+ version_requirements: *70246414385940
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: capybara
82
- requirement: &70362806158180 !ruby/object:Gem::Requirement
82
+ requirement: &70246414385480 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70362806158180
90
+ version_requirements: *70246414385480
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
- requirement: &70362806157560 !ruby/object:Gem::Requirement
93
+ requirement: &70246414385040 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70362806157560
101
+ version_requirements: *70246414385040
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: fakefs
104
- requirement: &70362806157140 !ruby/object:Gem::Requirement
104
+ requirement: &70246414384580 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70362806157140
112
+ version_requirements: *70246414384580
113
113
  description: ''
114
114
  email:
115
115
  - andrew.vos@gmail.com