Commit 20c5b0d1d3b2ff23c07a1b1edd6ee27edf9c1927
1 parent
83008eab
Exists in
master
and in
28 other branches
Changing tests to check diff posts and using strings instead files
Showing
2 changed files
with
19 additions
and
5 deletions
Show diff stats
app/controllers/public/content_viewer_controller.rb
... | ... | @@ -120,8 +120,8 @@ class ContentViewerController < ApplicationController |
120 | 120 | end |
121 | 121 | end |
122 | 122 | |
123 | - def self.versioning_articles(article1, article2) | |
124 | - Diffy::Diff.new('article1', 'article2', :source => 'files').to_s(:html) | |
123 | + def self.versioning_articles(string1, string2) | |
124 | + Diffy::Diff.new('string1', 'string2').to_s(:html) | |
125 | 125 | end |
126 | 126 | |
127 | 127 | protected | ... | ... |
test/functional/content_viewer_controller_test.rb
... | ... | @@ -1195,9 +1195,23 @@ class ContentViewerControllerTest < ActionController::TestCase |
1195 | 1195 | end |
1196 | 1196 | |
1197 | 1197 | should 'display differences between article versions' do |
1198 | - file1 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile) | |
1199 | - file2 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile) | |
1200 | - ContentViewerController.versioning_articles('file1','file2') | |
1198 | + blog = Blog.create!(:name => 'A blog test', :profile => profile) | |
1199 | + blog.posts << TinyMceArticle.create!( | |
1200 | + :name => 'Post1', | |
1201 | + :profile => profile, | |
1202 | + :parent => blog, | |
1203 | + :published => true, | |
1204 | + :body => "<p>This is a <strong>bold</strong> statement right there!</p>" | |
1205 | + ) | |
1206 | + | |
1207 | + blog.posts << TinyMceArticle.create!( | |
1208 | + :name => 'Post2', | |
1209 | + :profile => profile, | |
1210 | + :parent => blog, | |
1211 | + :published => true, | |
1212 | + :body => "<p>That is a <strong>bold</strong> statement right there!</p>" | |
1213 | + ) | |
1214 | + ContentViewerController.versioning_articles('Post1','Post2') | |
1201 | 1215 | end |
1202 | 1216 | |
1203 | 1217 | should 'not display comments marked as spam' do | ... | ... |