[folks] eds test: don't assume Individuals remain after changing a linkable property



commit 9fea7b641ac1d470200677c11baf0e10d6c4ca4d
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Fri Jan 4 15:15:57 2013 -0800

    eds test: don't assume Individuals remain after changing a linkable property

 tests/eds/set-emails.vala |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/tests/eds/set-emails.vala b/tests/eds/set-emails.vala
index 823aef0..bdb5429 100644
--- a/tests/eds/set-emails.vala
+++ b/tests/eds/set-emails.vala
@@ -111,9 +111,14 @@ public class SetEmailsTests : Folks.TestCase
 
           var name = (Folks.NameDetails) i;
 
-          if (name.full_name == "bernie h. innocenti")
+          if (name.full_name != "bernie h. innocenti")
+            continue;
+
+          /* Because we update a linkable property, we'll get a new individual
+           * because re-linking has to happen.
+           */
+          if (!this._found_before_update)
             {
-              i.notify["email-addresses"].connect (this._notify_emails_cb);
               this._found_before_update = true;
 
               foreach (var p in i.personas)
@@ -128,18 +133,16 @@ public class SetEmailsTests : Folks.TestCase
                   ((EmailDetails) p).email_addresses = emails;
                 }
             }
-        }
-    }
-
-  private void _notify_emails_cb (Object individual_obj, ParamSpec ps)
-    {
-      Folks.Individual i = (Folks.Individual) individual_obj;
-      foreach (var e in i.email_addresses)
-        {
-          if (e.value == "bernie example org")
+          else
             {
-              this._found_after_update = true;
-              this._main_loop.quit ();
+              foreach (var e in i.email_addresses)
+                {
+                  if (e.value == "bernie example org")
+                    {
+                      this._found_after_update = true;
+                      this._main_loop.quit ();
+                    }
+                }
             }
         }
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]