Stephen Compall avatar Stephen Compall committed 5a701ea

Test that get-object-view-fields uses super-powered direct shadowing

Comments (0)

Files changed (1)

test/views/view/utils.lisp

 					    (education :type mixin
 						       :view '(data education-history))
 					    (graduation-year :hidep t))))
-  (name manager university graduation-year))
+  (name manager university))
 
 (addtest get-object-view-fields.direct-shadows-mixedin
-  (ensure-same (mapcar #'print-field-info
-		       (get-object-view-fields
-			*joe* (defview () (:inherit-from '(:scaffold employee))
-				(education :type mixin
-					   :view '(data education-history))
-				(graduation-year))))
-	       '(name manager university graduation-year))
-  (ensure-same (mapcar #'print-field-info
-		       (get-object-view-fields
-			*joe* (defview () (:inherit-from '(:scaffold employee))
-				(education :type mixin
-					   :view '(data education-history))
-				(graduation-year :hidep t))
-			:include-invisible-p t))
-	       '(name manager university graduation-year)))
-
-(addtest get-object-view-fields.hidden-direct-noshadow
-  (let ((fields (get-object-view-fields
-		 *joe* (defview () (:inherit-from '(:scaffold employee))
-			 (education :type mixin
-				    :view '(data education-history))
-			 (graduation-year :hidep t)))))
-    (ensure-same (mapcar #'print-field-info fields)
-		 '(name manager university graduation-year))
-    (ensure-same (field-info-object (car (last fields))) *some-college*)))
+  (dolist (view (list (defview () (:inherit-from '(:scaffold employee))
+			(education :type mixin
+				   :view '(data education-history))
+			(graduation-year))
+		      (defview () (:inherit-from '(:scaffold employee))
+			(education :type mixin
+				   :view '(data education-history))
+			(graduation-year :hidep t))))
+    (let ((fields (get-object-view-fields *joe* view :include-invisible-p t)))
+      (ensure-same (mapcar #'print-field-info fields)
+		   '(name manager university graduation-year))
+      (ensure-same (field-info-object (car (last fields)))
+		   *joe*))))
 
 (addtest get-object-view-fields.direct-shadow-proper-mixin
   (let ((fields (get-object-view-fields
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.