spec_views 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 327822c86f6aac9cd2d8e9c31e06465df710a3b4806d42c5899cbbf6e6a59a02
4
- data.tar.gz: 99f42b68d14679146f5b2a7c9e01bad4e9c9a0a1b241d1880a223bb560004126
3
+ metadata.gz: bf7bc86e0273d8a6c9f07835a90f1a142585672b2a4b274686f40699ddd26ec7
4
+ data.tar.gz: 96167d907e224df18c9d41190e31f00546c41bf4812fbe0f896bf50bb1ea51e9
5
5
  SHA512:
6
- metadata.gz: c02702e4aa11e099daf606f54bedae303f330a6e5135e786835ff7c5483d329a9ac6218e1e584e76aa9f74feb69d64bfb29a38bd9087cc5c9141917e004aa8d5
7
- data.tar.gz: 186aa286db5f8d583f747a39a46ac8531036156715308468d1eb07847626e8337260583d48e084a5063b2200dc1ae1e29e9e1f3cc06221037cd46a82b96b93c7
6
+ metadata.gz: 804a01e51bf028bc19a86626493736cee085e9151aafba1b3158e4500a97b1082c7324e84de8994940831da2a4ea84d78fbc5d19393489c8afb5b18a5d626513
7
+ data.tar.gz: 15d1e2a4c2ecebd4652a30ce9b7455b6f74a276697d35abccda2dc317a34512b9541a616b21d5c4647bb0ced3ab816518a44f0569965dc1ce9d19a5f4b460ddd
data/README.md CHANGED
@@ -1,18 +1,5 @@
1
1
  # SpecViews
2
- Render views from controller specs for comparision
3
-
4
- ## Usage
5
- Replace selected RSpec `it` methods with `render`:
6
-
7
- ```ruby
8
- RSpec.describe HomeController, type: :controller do
9
- describe 'GET #show' do
10
- render 'homepage' do
11
- get :show
12
- end
13
- end
14
- end
15
- ```
2
+ Render views from controller specs for comparision.
16
3
 
17
4
  ## Installation
18
5
  Add this line to your application's Gemfile:
@@ -33,9 +20,24 @@ $ bundle
33
20
 
34
21
  Ignore some generated files in your .gitignore:
35
22
  ```bash
36
- /spec/fixtures/views/*/challenger.html
23
+ /spec/fixtures/views/*/challenger.*
37
24
  /spec/fixtures/views/*/last_run.txt
38
25
  ```
39
26
 
27
+ ## Usage
28
+ Replace selected RSpec `it` methods with `render`:
29
+
30
+ ```ruby
31
+ RSpec.describe HomeController, type: :controller do
32
+ describe 'GET #show' do
33
+ render 'homepage' do
34
+ get :show
35
+ end
36
+ end
37
+ end
38
+ ```
39
+
40
+ Run this spec to see it failing. Open SpecView UI [http://localhost:3000/spec_views](http://localhost:3000/spec_views) on Rails development server to accept the new view. When rerunning the spec it compares its rendering with the reference view. Use SpecView UI to review, accept or reject changed views.
41
+
40
42
  ## License
41
43
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -104,7 +104,7 @@ module SpecViews
104
104
  end
105
105
 
106
106
  def sanitized_body
107
- return body if pdf?
107
+ return remove_headers_from_pdf(body) if pdf?
108
108
 
109
109
  remove_pack_digests_from_body(
110
110
  remove_digests_from_body(body),
@@ -119,6 +119,10 @@ module SpecViews
119
119
  body.gsub(%r{(packs.*/js/[a-z0-9_]+)(-[a-z0-9]{20})(\.js)}, '\1\3')
120
120
  end
121
121
 
122
+ def remove_headers_from_pdf(pdf)
123
+ pdf.gsub(/^\/CreationDate.*$/, '')
124
+ end
125
+
122
126
  def put_write_instructions
123
127
  puts
124
128
  puts "\e[33mWarning:\e[0m Writing view fixture to #{champion_path.to_s.gsub(Rails.root.to_s, '')}"
@@ -1,3 +1,3 @@
1
1
  module SpecViews
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.0'
3
3
  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: 1.0.1
4
+ version: 1.1.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: 2022-01-17 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails