Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

use heredocs for clarity in journals controller spec

Ivan Kuchin53e38fb1b53d
diff --git a/spec/controllers/journals_controller_spec.rb b/spec/controllers/journals_controller_spec.rb
index 3e4df64e955..e81735ba4ff 100644
--- a/spec/controllers/journals_controller_spec.rb
+++ b/spec/controllers/journals_controller_spec.rb
@@ -59,14 +59,13 @@ RSpec.describe JournalsController do
it { expect(response).to have_http_status(:ok) }
it "presents the diff correctly" do
- expect(response.body.strip).to eq(
- "<div class=\"text-diff\">" \
- "\n " \
- "<label class=\"hidden-for-sighted\">Begin of the insertion</label><ins class=\"diffmod\">description</ins>" \
- "<label class=\"hidden-for-sighted\">End of the insertion</label>" \
- "\n" \
- "</div>"
- )
+ expect(response.body.strip).to be_html_eql <<-HTML
+ <div class="text-diff">
+ <label class="hidden-for-sighted">Begin of the insertion</label>
+ <ins class="diffmod">description</ins>
+ <label class="hidden-for-sighted">End of the insertion</label>
+ </div>
+ HTML
end
end
@@ -104,14 +103,13 @@ RSpec.describe JournalsController do
it { expect(response).to have_http_status(:ok) }
it "presents the diff correctly" do
- expect(response.body.strip).to eq(
- "<div class=\"text-diff\">" \
- "\n " \
- "<label class=\"hidden-for-sighted\">Begin of the insertion</label><ins class=\"diffmod\">foo</ins>" \
- "<label class=\"hidden-for-sighted\">End of the insertion</label>" \
- "\n" \
- "</div>"
- )
+ expect(response.body.strip).to be_html_eql <<-HTML
+ <div class="text-diff">
+ <label class="hidden-for-sighted">Begin of the insertion</label>
+ <ins class="diffmod">foo</ins>
+ <label class="hidden-for-sighted">End of the insertion</label>
+ </div>
+ HTML
end
end
@@ -159,14 +157,13 @@ RSpec.describe JournalsController do
it { expect(response).to have_http_status(:ok) }
it "presents the diff correctly" do
- expect(response.body.strip).to eq(
- "<div class=\"text-diff\">" \
- "\n " \
- "<label class=\"hidden-for-sighted\">Begin of the insertion</label><ins class=\"diffmod\">description</ins>" \
- "<label class=\"hidden-for-sighted\">End of the insertion</label>" \
- "\n" \
- "</div>"
- )
+ expect(response.body.strip).to be_html_eql <<-HTML
+ <div class="text-diff">
+ <label class="hidden-for-sighted">Begin of the insertion</label>
+ <ins class="diffmod">description</ins>
+ <label class="hidden-for-sighted">End of the insertion</label>
+ </div>
+ HTML
end
end