From 9fea7b641ac1d470200677c11baf0e10d6c4ca4d Mon Sep 17 00:00:00 2001 From: Travis Reitter Date: Fri, 4 Jan 2013 15:15:57 -0800 Subject: [PATCH] eds test: don't assume Individuals remain after changing a linkable property --- tests/eds/set-emails.vala | 29 ++++++++++++++++------------- 1 file 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 (); + } + } } } } -- 2.7.4