mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
FIX: Missing iframe closing tag in discobot certificate (#13052)
When issuing the discobot certificate, we were not closing the iframe tag, which meant that the final message instruction to the user was swallowed up.
This commit is contained in:
parent
3d2cace94f
commit
b690e7787e
@ -137,7 +137,7 @@ module DiscourseNarrativeBot
|
||||
src = Discourse.base_url + DiscourseNarrativeBot::Engine.routes.url_helpers.certificate_path(options)
|
||||
alt = CGI.escapeHTML(I18n.t("#{self.class::I18N_KEY}.certificate.alt"))
|
||||
|
||||
"<iframe class='discobot-certificate' src='#{src}' width='650' height='464' alt='#{alt}'>"
|
||||
"<iframe class='discobot-certificate' src='#{src}' width='650' height='464' alt='#{alt}'></iframe>"
|
||||
end
|
||||
|
||||
protected
|
||||
|
@ -715,7 +715,7 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
end
|
||||
end
|
||||
|
||||
it 'should create the right reply' do
|
||||
it 'should create the right reply and issue the discobot certificate' do
|
||||
post.update!(raw: "[details=\"This is a test\"]\nwooohoo\n[/details]")
|
||||
narrative.input(:reply, user, post: post)
|
||||
|
||||
@ -729,6 +729,12 @@ RSpec.describe DiscourseNarrativeBot::AdvancedUserNarrative do
|
||||
|
||||
expect(user.badges.where(name: DiscourseNarrativeBot::AdvancedUserNarrative.badge_name).exists?)
|
||||
.to eq(true)
|
||||
|
||||
expect(topic.ordered_posts.last.cooked).to include("<iframe")
|
||||
expect(Nokogiri::HTML5(topic.ordered_posts.last.cooked).at("iframe").text).not_to include(
|
||||
"Bye for now"
|
||||
)
|
||||
expect(topic.ordered_posts.last.cooked).to include("</iframe>")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user