require 'spec_helper' require 'discourse_diff' describe DiscourseDiff do describe "inline_html" do it "returns an empty div when no content is diffed" do DiscourseDiff.new("", "").inline_html.should == "
" end it "returns the diffed content when there is no difference" do before = after = "this is a paragraph
" DiscourseDiff.new(before, after).inline_html.should == "this is a paragraph
this is a paragraph
" after = "this is a great paragraph
" DiscourseDiff.new(before, after).inline_html.should == "this is a great paragraph
this is a great paragraph
" after = "this is a paragraph
" DiscourseDiff.new(before, after).inline_html.should == "this is a great paragraph
this is the first paragraph
" after = "this is the first paragraph
this is the second paragraph
" DiscourseDiff.new(before, after).inline_html.should == "this is the first paragraph
this is the second paragraph
this is the first paragraph
this is the second paragraph
" after = "this is the second paragraph
" DiscourseDiff.new(before, after).inline_html.should == "this is the first paragraph
this is the second paragraph
this is a paragraph
" DiscourseDiff.new(before, after).side_by_side_html.should == "this is a paragraph
this is a paragraph
this is a paragraph
" after = "this is a great paragraph
" DiscourseDiff.new(before, after).side_by_side_html.should == "this is a paragraph
this is a great paragraph
this is a great paragraph
" after = "this is a paragraph
" DiscourseDiff.new(before, after).side_by_side_html.should == "this is a great paragraph
this is a paragraph
this is the first paragraph
" after = "this is the first paragraph
this is the second paragraph
" DiscourseDiff.new(before, after).side_by_side_html.should == "this is the first paragraph
this is the first paragraph
this is the second paragraph
this is the first paragraph
this is the second paragraph
" after = "this is the second paragraph
" DiscourseDiff.new(before, after).side_by_side_html.should == "this is the first paragraph
this is the second paragraph
this is the second paragraph
<img src="//domain.com/image.png>" |
this is a paragraph | this is a paragraph |
this is a paragraph | this is a great paragraph |
this is a | this is a paragraph |
this is the first paragraph | this is the first paragraph\nthis is the second paragraph |
this is the first paragraph\n | |
this is the second paragraph | this is the second paragraph |