Skip to content

Commit

Permalink
add broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
MeredithAnya committed Feb 9, 2021
1 parent e14a3df commit 8409f50
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/sentry/integrations/slack/test_action_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,17 +412,22 @@ def test_slack_bad_payload(self, check_signing_secret_mock):
resp = self.client.post("/extensions/slack/action/", data={"nopayload": 0})
assert resp.status_code == 400

@patch(
"sentry.integrations.slack.requests.SlackRequest._check_signing_secret", return_value=True
)
def test_sentry_docs_link_clicked(self, check_signing_secret_mock):
def test_sentry_docs_link_clicked(self):
payload = {
"team": {"id": "TXXXXXXX1", "domain": "example.com"},
"user": {"id": self.identity.external_id, "domain": "example"},
"type": "block_actions",
"actions": [{"value": "sentry_docs_link_clicked"}],
}

payload = {"payload": json.dumps(payload)}
from tests.sentry.integrations.slack.test_requests import set_signature
from sentry import options
from urllib.parse import urlencode

headers = set_signature(
options.get("slack.signing-secret"), urlencode(payload).encode("utf-8")
)

resp = self.client.post("/extensions/slack/action/", data=payload)
resp = self.client.post("/extensions/slack/action/", data=payload, **headers)
assert resp.status_code == 200

0 comments on commit 8409f50

Please sign in to comment.