aygabtu 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +14 -0
- data/Gemfile +2 -0
- data/README.md +22 -5
- data/lib/aygabtu/handle.rb +4 -1
- data/lib/aygabtu/point_of_call.rb +6 -6
- data/lib/aygabtu/rspec.rb +7 -3
- data/lib/aygabtu/version.rb +1 -1
- data/spec/support/identifies_routes.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 820b903bfa3013e8b888d87c17d5c378fae75ecd
|
4
|
+
data.tar.gz: d2d923d2c5eeb6bc6f053d80daa871c5b6e251ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a78573431064dfe833d44a863991f901cf61b9cae68b359343df51b05c571c0b39f00f23dc07a1c2bbb3ebf2d7d755dfa2d853aed21245b4d29c3a0c7733ed9
|
7
|
+
data.tar.gz: 7758b5b65c947f5c9b9f35f42469378294a925915ae1c9ed75a2d6c6b09f976ad706a13c577f2dd4f4a0bf4859335f9ca7621f083487f695f6b8f3c2522e26af
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 0.3.0 (2016-03-01)
|
2
|
+
|
3
|
+
Breaking change:
|
4
|
+
|
5
|
+
- dropped support for ruby 1.9.3, added ruby 2.2 to CI matrix
|
6
|
+
|
7
|
+
Improvements
|
8
|
+
|
9
|
+
- documentation
|
10
|
+
|
11
|
+
New feature:
|
12
|
+
|
13
|
+
- aygabtu_select_route? extension point
|
14
|
+
|
1
15
|
## 0.2.0 (2015-04-28)
|
2
16
|
|
3
17
|
Breaking change:
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -32,13 +32,14 @@ Or install it yourself as:
|
|
32
32
|
Create `spec/features/aygabtu_features_spec.rb` with the following content:
|
33
33
|
|
34
34
|
```
|
35
|
-
require '
|
35
|
+
require 'rails_helper'
|
36
36
|
|
37
37
|
require 'aygabtu/rspec'
|
38
38
|
|
39
39
|
describe "Aygabtu generated features", type: :feature do
|
40
40
|
include Aygabtu::RSpec.example_group_module
|
41
41
|
|
42
|
+
# callback method for asserting against a loaded page
|
42
43
|
def aygabtu_assertions
|
43
44
|
aygabtu_assert_status_success
|
44
45
|
aygabtu_assert_not_redirected_away
|
@@ -48,7 +49,7 @@ describe "Aygabtu generated features", type: :feature do
|
|
48
49
|
|
49
50
|
# must be at the very bottom
|
50
51
|
remaining.static_routes.visit
|
51
|
-
remaining.pend "pending because route
|
52
|
+
remaining.pend "pending because route requires segments to be visited"
|
52
53
|
end
|
53
54
|
```
|
54
55
|
|
@@ -227,13 +228,29 @@ You can also use `remaining` at the very bottom to pend all remaining routes, se
|
|
227
228
|
* `dynamic_routes` matches routes which have a dynamic segment.
|
228
229
|
* `static_routes` matches routes which have no dynamic segment.
|
229
230
|
|
230
|
-
##
|
231
|
+
## Extension points
|
231
232
|
|
232
|
-
|
233
|
+
Several class and instance methods (read: example group and example methods)
|
234
|
+
can be overwritten to tweak behaviour as needed.
|
235
|
+
|
236
|
+
### `#aygabtu_assertions`
|
237
|
+
|
238
|
+
This is already demonstrated in the initial example. It is necessary
|
239
|
+
to override this method with assertions specific to your project. Besides using
|
240
|
+
available assertions as shown, add an assertion against an element common to all
|
241
|
+
pages (fex. inside the site footer) and a negative assertion against text
|
242
|
+
found in your 404 page.
|
243
|
+
|
244
|
+
### `.aygabtu_select_route?`
|
245
|
+
|
246
|
+
Allows to filter out unwanted routes at a low level. This method is passed a route object
|
247
|
+
from the journey gem and returns true for every route to be considered by aygabtu.
|
248
|
+
|
249
|
+
This method helps keeping deep project specific knowledge and the knowledge about Rails interna needed
|
250
|
+
to implement filtering out of aygabtu by giving users control.
|
233
251
|
|
234
252
|
## Missing features
|
235
253
|
|
236
|
-
* tests, preferrably against different versions of Rails, RSpec and capybara
|
237
254
|
* support for example metadata (you can have it with a conventional `context` any time)
|
238
255
|
|
239
256
|
## Contributing
|
data/lib/aygabtu/handle.rb
CHANGED
@@ -3,6 +3,9 @@ require_relative 'scope_actor'
|
|
3
3
|
|
4
4
|
module Aygabtu
|
5
5
|
class Handle
|
6
|
+
def initialize
|
7
|
+
@verbose = false
|
8
|
+
end
|
6
9
|
|
7
10
|
def routes
|
8
11
|
@routes ||= rails_application_routes.set.map do |journey_route|
|
@@ -25,7 +28,7 @@ module Aygabtu
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def verbose?
|
28
|
-
|
31
|
+
@verbose
|
29
32
|
end
|
30
33
|
|
31
34
|
private
|
@@ -15,14 +15,14 @@ module Aygabtu
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.gem_root
|
18
|
-
|
18
|
+
@gem_root ||= begin
|
19
|
+
path = Pathname(__FILE__)
|
20
|
+
while new_path = path.parent and new_path.to_s.include?('lib/aygabtu')
|
21
|
+
path = new_path
|
22
|
+
end
|
19
23
|
|
20
|
-
|
21
|
-
while new_path = path.parent and new_path.to_s.include?('lib/aygabtu')
|
22
|
-
path = new_path
|
24
|
+
path.to_s
|
23
25
|
end
|
24
|
-
|
25
|
-
@gem_root= path.to_s
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/aygabtu/rspec.rb
CHANGED
@@ -43,9 +43,13 @@ module Aygabtu
|
|
43
43
|
|
44
44
|
def aygabtu_matching_routes(scope = aygabtu_scope)
|
45
45
|
scope = scope.scope if scope.respond_to?(:scope) # a scope chain can be pased as well
|
46
|
-
aygabtu_handle.routes.select
|
47
|
-
scope.matches_route?(route)
|
48
|
-
|
46
|
+
aygabtu_handle.routes.select { |route|
|
47
|
+
scope.matches_route?(route) && aygabtu_select_route?(route.journey_route)
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
def aygabtu_select_route?(journey_route)
|
52
|
+
true
|
49
53
|
end
|
50
54
|
|
51
55
|
ScopeActor.actions.each do |action|
|
data/lib/aygabtu/version.rb
CHANGED
@@ -7,7 +7,7 @@ module IdentifiesRoutes
|
|
7
7
|
satisfy { |rw| rw.journey_route.defaults[:route_identifier] == identifier }
|
8
8
|
end
|
9
9
|
|
10
|
-
def route_identified_by(identifier, all_routes = all_routes)
|
10
|
+
def route_identified_by(identifier, all_routes = all_routes())
|
11
11
|
identified_routes = all_routes.select do |rw|
|
12
12
|
rw.journey_route.defaults[:route_identifier] == identifier
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aygabtu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Stratmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-rails
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.4.5.1
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Feature test generator for GET requests
|
@@ -120,4 +120,3 @@ test_files:
|
|
120
120
|
- spec/support/matcher_shims.rb
|
121
121
|
- spec/support_spec/identifies_routes_spec.rb
|
122
122
|
- spec/visiting_routes_spec.rb
|
123
|
-
has_rdoc:
|