try/40_customer_try.rb in familia-1.0.0.pre.rc7 vs try/40_customer_try.rb in familia-1.1.0.pre.rc1
- old
+ new
@@ -16,11 +16,11 @@
## Customer can be saved
@customer.save
#=> true
## Customer can be retrieved by identifier
-retrieved_customer = Customer.from_identifier("test@example.com")
+retrieved_customer = Customer.find_by_id("test@example.com")
retrieved_customer.custid
#=> "test@example.com"
## Customer fields can be accessed
@customer.email
@@ -33,15 +33,15 @@
## Customer can update fields
@customer.planid = "premium"
@customer.save
ident = @customer.identifier
-Customer.from_identifier(ident).planid
+Customer.find_by_id(ident).planid
#=> "premium"
## Customer can increment secrets_created counter
-@customer.secrets_created.clear
+@customer.secrets_created.delete!
@customer.secrets_created.increment
@customer.secrets_created.value
#=> '1'
## Customer can add custom domain via add method
@@ -72,11 +72,11 @@
Customer.instances << @customer
Customer.instances.member?(@customer)
#=> true
## Customer can be removed from class-level sorted set
-Customer.instances.delete(@customer)
+Customer.instances.remove(@customer)
Customer.instances.member?(@customer)
#=> false
## Customer can add a session
@customer.sessions << "session123"
@@ -88,11 +88,11 @@
@customer.password_reset["token"]
#=> "reset123"
## Customer can be destroyed
ret = @customer.destroy!
-cust = Customer.from_identifier("test@example.com")
+cust = Customer.find_by_id("test@example.com")
exists = Customer.exists?("test@example.com")
[ret, cust.nil?, exists]
#=> [true, true, false]
## Customer.destroy! can be called on an already destroyed object
@@ -135,6 +135,6 @@
Customer.instances.uri.to_s
#=> 'redis://127.0.0.1/15/'
# Teardown
-Customer.instances.clear
+Customer.instances.delete!