not sure about if be_true is exactly what you want to test here. It is misleading about what data['customer_paymen_profile_id] should contain. If you are only validating the presence of that key, use something like .present? blank? or empty? according your needs.