|
@@ -664,7 +664,8 @@ class UpdateProjectRuleTest(ProjectRuleDetailsBaseTestCase):
|
|
|
self.organization.slug, self.project.slug, self.rule.id, status_code=200, **payload
|
|
|
)
|
|
|
|
|
|
- def test_reenable_disabled_rule(self):
|
|
|
+ @patch("sentry.analytics.record")
|
|
|
+ def test_reenable_disabled_rule(self, record_analytics):
|
|
|
"""Test that when you edit and save a rule that was disabled, it's re-enabled as long as it passes the checks"""
|
|
|
rule = Rule.objects.create(
|
|
|
label="hello world",
|
|
@@ -693,6 +694,14 @@ class UpdateProjectRuleTest(ProjectRuleDetailsBaseTestCase):
|
|
|
rule = Rule.objects.get(id=rule.id)
|
|
|
assert rule.status == ObjectStatus.ACTIVE
|
|
|
|
|
|
+ assert self.analytics_called_with_args(
|
|
|
+ record_analytics,
|
|
|
+ "rule_reenable.edit",
|
|
|
+ rule_id=rule.id,
|
|
|
+ user_id=self.user.id,
|
|
|
+ organization_id=self.organization.id,
|
|
|
+ )
|
|
|
+
|
|
|
@patch("sentry.analytics.record")
|
|
|
def test_rule_disable_opt_out_explicit(self, record_analytics):
|
|
|
"""Test that if a user explicitly opts out of their neglected rule being migrated
|