rspec_jsonapi_serializer 1.3.1 → 1.3.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: 3617cae7caacd8695894c6395f675128d6bca1c995b66a2c5710e2f30de821d5
4
- data.tar.gz: f8a012ed9e4e291dfdafeded91f460ce1273c64bdf0e6fc18b7c3aa56c7dc6e7
3
+ metadata.gz: 7bef199f60191871be0b7528072eded0d5ecd55e2fb49a2a83680fc4d2a98f2a
4
+ data.tar.gz: 00a01603973af7929de6623549c79971dc16f333f3e10e96ffcc5e6e8f406caf
5
5
  SHA512:
6
- metadata.gz: 4464405e91954ab43d68dbc886e8c8ab13f646ebad343ec95879ace14ef4a4b42515f7f9b8d035b84d4b0bd92be4b297188427f647d626e18afb101353cc3cfb
7
- data.tar.gz: 6b071952ee12ad8621d8724d606c9e19b3ff049104f3b8d83b72dddd29055dfcc4276661f7f914763ee3d6c28632bcf3d71138af556d41a8228b187e07f294da
6
+ metadata.gz: 57a10c5dfa8ca0bb4b572fc72c7a6a38bb652d7c8fd05375544571b304b067a6c46a51f5fdafd449385c2b089fcab4e338982e4b79db19b055f69182a248b084
7
+ data.tar.gz: 77ef7f71d310619a54e1bbcc8714af9cdb9c4d9e3a2599f5624b283a5d78d708c943e3392333b32cb7fcd1792bcf8578ef1bfb9b703a0c07b29419c01c4f0460
@@ -69,13 +69,20 @@ module RSpecJSONAPISerializer
69
69
  end
70
70
 
71
71
  def relationship_matches?
72
- actual.present? && actual_relationship_type == relationship_type
72
+ actual.present? && actual_relationship_type == relationship_type &&
73
+ actual_rendered?
73
74
  end
74
75
 
75
76
  def association_message
76
77
  relationship_matcher.to_s.split("_").join(" ")
77
78
  end
78
79
 
80
+ def actual_rendered?
81
+ relationships = serializable_hash.dig(:data, :relationships)
82
+
83
+ relationships.key?(expected) || relationships.key?(expected.to_s)
84
+ end
85
+
79
86
  def actual_relationship_type
80
87
  actual.relationship_type
81
88
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RSpecJSONAPISerializer
4
- VERSION = "1.3.1"
4
+ VERSION = "1.3.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_jsonapi_serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mateus Cruz