inertia_rails 1.9.1 → 1.9.2

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: 8b998cadfc3e3285f53cee917e812536b2d735099b738cde2c6aa215480d0a78
4
- data.tar.gz: e4bbfbdfafbb994db348d3ef7d6c6082227b54a92f2f5588e0eaa72b833b7491
3
+ metadata.gz: 84d7a55c30678d9984236bdca8442ff34268cb09ff8795560d0506678acf9ab8
4
+ data.tar.gz: 48308b96e0e2cf06c70027649acc8e992f280743fd5cae05c70a49c4d8ec343e
5
5
  SHA512:
6
- metadata.gz: 3afe130f99ae9d4c22976c4aca5ab5309aa407da431551432c2d150066c8f8914a8f6a30995f36bf70326f6880cdaafe9727183dcd7b63dc77c130039ecfc06c
7
- data.tar.gz: 7d68480b6f781ae9533d40a891f470dbb0478b9db6b037abe267c5b32ac661152790a4ae6c7b904356dd597e1aed6804ef0609c9f96064275b91a9cde89835af
6
+ metadata.gz: b8ab3b00e2ee6a44649924fd60aefad32bd5bd33621a12c45ddb692f49d7220a4f1a3837334d983ce614a30c9144249c23f280918b8fbc9b75aef2f97cfad04d
7
+ data.tar.gz: de4d10ec3200f4d45a50c2a1cb2abcc479182f4cee135b9401f43679ad1e296031c644982b9d2fa5e5a5875f1fe909b8dfcda941e933927028b0f7cbdbbb8d97
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.9.2] - 2021-02-23
8
+
9
+ * Improve method for detecting whether a user used the RSpec helpers without adding `inertia: true` to the spec
10
+ * Emit a warning when expecting an Inertia response in RSpec and never reaching a `render inertia:` call
11
+
7
12
  ## [1.9.1] - 2021-02-10
8
13
 
9
14
  * Define `redirect_to` and `redirect_back` as public methods for compatibility with other code using them
@@ -35,6 +35,9 @@ module InertiaRails
35
35
  def inertia
36
36
  raise 'Inertia test helpers aren\'t set up! Make sure you add inertia: true to describe blocks using inertia tests.' unless inertia_tests_setup?
37
37
 
38
+ if @_inertia_render_wrapper.nil? && !::RSpec.configuration.inertia[:skip_missing_renderer_warnings]
39
+ warn 'WARNING: the test never created an Inertia renderer. Maybe the code wasn\'t able to reach a `render inertia:` call? If this was intended, or you don\'t want to see this message, set ::RSpec.configuration.inertia[:skip_missing_renderer_warnings] = true'
40
+ end
38
41
  @_inertia_render_wrapper
39
42
  end
40
43
 
@@ -49,7 +52,7 @@ module InertiaRails
49
52
  protected
50
53
 
51
54
  def inertia_tests_setup?
52
- @_inertia_render_wrapper.present?
55
+ ::RSpec.current_example.metadata.fetch(:inertia, false)
53
56
  end
54
57
  end
55
58
  end
@@ -57,6 +60,9 @@ end
57
60
 
58
61
  RSpec.configure do |config|
59
62
  config.include ::InertiaRails::RSpec::Helpers
63
+ config.add_setting :inertia, default: {
64
+ skip_missing_renderer_warnings: false
65
+ }
60
66
 
61
67
  config.before(:each, inertia: true) do
62
68
  new_renderer = InertiaRails::Renderer.method(:new)
@@ -1,3 +1,3 @@
1
1
  module InertiaRails
2
- VERSION = "1.9.1"
2
+ VERSION = "1.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inertia_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Knoles
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-02-10 00:00:00.000000000 Z
13
+ date: 2021-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails