Updated

spec/helpers / markdown_helper_spec.rb

B
23 lines of codes
0 methods
N/A complexity/method
1 churn
41.8 complexity
48 duplications
require 'rails_helper' RSpec.describe MarkdownHelper, type: :helper do describe "#markdown_to_html" do
  1. Similar code found in 2 nodes Locations: 0 1
it "converts markdown to html" do expect(helper.markdown_to_html("## Petitions: UK Government and Parliament")).to eq(%[<h2>Petitions: UK Government and Parliament</h2>\n]) end it "autolinks urls" do expect(helper.markdown_to_html("www.example.com")).to eq(%[<p><a href="http://www.example.com">www.example.com</a></p>\n]) end end describe "#markdown_to_text" do
  1. Similar code found in 2 nodes Locations: 0 1
it "converts markdown to text" do expect(helper.markdown_to_text("## Petitions: UK Government and Parliament")).to eq(%[Petitions: UK Government and Parliament\n]) end it "autolinks urls" do expect(helper.markdown_to_text("www.example.com")).to eq(%[www.example.com (http://www.example.com)\n]) end end end