lib/mailstro/test_strategy.rb in mailstro-0.0.9 vs lib/mailstro/test_strategy.rb in mailstro-0.0.10
- old
+ new
@@ -8,25 +8,18 @@
def self.clear
@@deliveries = []
end
- def self.deliver(options)
- @@deliveries << Delivery.new(options)
+ def self.deliver(email_name, options)
+ @@deliveries << Delivery.new(email_name, options)
end
- def self.has_delivered?(conditions)
+ def self.has_delivered?(email_name, conditions)
@@deliveries.any? do |delivery|
- result = true
- if conditions.is_a?(Hash)
- if conditions[:template_name]
- result = result && delivery.template_name == conditions[:template_name]
- end
- if conditions[:to]
- result = result && delivery.contact_email == conditions[:to]
- end
- else
- result = delivery.template_name == conditions
+ result = delivery.email_name == email_name
+ if conditions[:to]
+ result = result && delivery.to == conditions[:to]
end
result
end
end
end