Prior to taking property with someone else, spouse (common-law, married, same-sex) or friend, decide how you wish to own the property. Joint Tenants- when one person dies the other owner, gets the entire property. With Tenants in Common, one owner can leave their share of the property to anyone they choose.
It is rare for the courts to break a joint tenancy, if the property is a matrimonial home. Other situations, where a joint tenant, decides to give their share to someone, that is not the other joint tenant, would depend on the fact situation.
Mark Weisleder, in the Toronto Star, has a great example of when a joint-tenancy was not broken. Here is the link http://www.moneyville.ca/article/1111043–know-your-rights-when-you-share-a-property