mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
FIX: Check if invite has expired before showing it (#10581)
This commit is contained in:
@ -20,6 +20,18 @@ describe InvitesController do
|
||||
expect(CGI.unescapeHTML(body)).to include(I18n.t('invite.not_found', base_url: Discourse.base_url))
|
||||
end
|
||||
|
||||
it "returns error if invite expired" do
|
||||
invite.update(expires_at: 1.day.ago)
|
||||
|
||||
get "/invites/#{invite.invite_key}"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
body = response.body
|
||||
expect(body).to_not have_tag(:script, with: { src: '/assets/application.js' })
|
||||
expect(CGI.unescapeHTML(body)).to include(I18n.t('invite.not_found', base_url: Discourse.base_url))
|
||||
end
|
||||
|
||||
it "renders the accept invite page if invite exists" do
|
||||
get "/invites/#{invite.invite_key}"
|
||||
|
||||
|
Reference in New Issue
Block a user