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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bef199f60191871be0b7528072eded0d5ecd55e2fb49a2a83680fc4d2a98f2a
|
4
|
+
data.tar.gz: 00a01603973af7929de6623549c79971dc16f333f3e10e96ffcc5e6e8f406caf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|