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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6be6b1290f526d5601ea7896dfd29bda9913888f4620b752504d6e2931ba6fa
4
- data.tar.gz: 9d6c11ddb9c2ff9b0898f9c887a07823555732e714341680feb8dba4ecb9e020
3
+ metadata.gz: b9d735d5be23258478cd7985580dbd28795d0c56d0a4047437cdef7b05d7f50c
4
+ data.tar.gz: 501d7d05ac210122760f79706da9bba4c02dfb04e2ef0f73e00195925a054c33
5
5
  SHA512:
6
- metadata.gz: 3a120d0d9d5b5810dbc6978c191ca378118a8554eb9aaa0e391afc41605b7652292205545a74402a85ddecce82faf235aaa6195e5513bc24f3509710520928c9
7
- data.tar.gz: ec0abff6c3d017ced148a464001bc58f9730314c8d4334122f22d29c42ec0fe61f09ea97fbb12f2fc38b2b9a543c4198f4f91167b9274c77da5aecafca6c690d
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
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SpecViews
4
- VERSION = '3.4.0'
4
+ VERSION = '3.5.0'
5
5
  end
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.0
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: 2023-11-16 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs