spec_views 3.4.0 → 3.5.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/README.md +17 -0
- data/lib/spec_views/support.rb +4 -0
- data/lib/spec_views/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9d735d5be23258478cd7985580dbd28795d0c56d0a4047437cdef7b05d7f50c
|
4
|
+
data.tar.gz: 501d7d05ac210122760f79706da9bba4c02dfb04e2ef0f73e00195925a054c33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c0ae84c37be9a0e2c08000036fae329cee08e4d1e23d29d224997ae397f300c8b8ad0908f36b82811adeb316206c159e6a164be33c39eacc026fe4da7f35295
|
7
|
+
data.tar.gz: 69457a1c2df67cb8fa1bf1ddcab8ad85720ccc40dae44b7b9cd0ab7b76cc908b3e7b0f8a90209b50e96235f4bcd620ca98087ba9188bd27c102998e164fbf67d
|
data/README.md
CHANGED
@@ -79,6 +79,23 @@ RSpec.describe "Articles", type: :request do
|
|
79
79
|
end
|
80
80
|
```
|
81
81
|
|
82
|
+
### Add an affix
|
83
|
+
If you have two requests with the same description, you can add an affix to the generated name:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
RSpec.describe "Articles", type: :request do
|
87
|
+
describe 'GET /articles' do
|
88
|
+
it 'renders the listing' do
|
89
|
+
get articles_path
|
90
|
+
expect(response).to match_html_fixture.with_affix('only 10')
|
91
|
+
|
92
|
+
get articles_path(all: '1')
|
93
|
+
expect(response).to match_html_fixture.with_affix('all')
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
82
99
|
### PDF matching
|
83
100
|
If your request responds with a PDF you can compare it as well:
|
84
101
|
|
data/lib/spec_views/support.rb
CHANGED
@@ -55,10 +55,14 @@ matchers.each do |matcher|
|
|
55
55
|
chain :for_status do |status|
|
56
56
|
@status = status
|
57
57
|
end
|
58
|
+
chain :with_affix do |affix|
|
59
|
+
@affix = affix
|
60
|
+
end
|
58
61
|
|
59
62
|
match do |actual|
|
60
63
|
example = @matcher_execution_context.instance_variable_get('@_spec_view_example')
|
61
64
|
description = example.full_description
|
65
|
+
description = "#{description}-#{@affix}" if @affix.present?
|
62
66
|
type = example.metadata[:type]
|
63
67
|
run_time = $_spec_view_time # rubocop:disable Style/GlobalVars
|
64
68
|
@status ||= :ok
|
data/lib/spec_views/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spec_views
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Gaul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|