From 20c5b0d1d3b2ff23c07a1b1edd6ee27edf9c1927 Mon Sep 17 00:00:00 2001 From: Junior Silva Date: Fri, 17 Jan 2014 18:43:11 -0300 Subject: [PATCH] Changing tests to check diff posts and using strings instead files --- app/controllers/public/content_viewer_controller.rb | 4 ++-- test/functional/content_viewer_controller_test.rb | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index 001b2ce..8eb292a 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -120,8 +120,8 @@ class ContentViewerController < ApplicationController end end - def self.versioning_articles(article1, article2) - Diffy::Diff.new('article1', 'article2', :source => 'files').to_s(:html) + def self.versioning_articles(string1, string2) + Diffy::Diff.new('string1', 'string2').to_s(:html) end protected diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 1de9887..9e9784b 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -1195,9 +1195,23 @@ class ContentViewerControllerTest < ActionController::TestCase end should 'display differences between article versions' do - file1 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile) - file2 = UploadedFile.create!(:uploaded_data => fixture_file_upload('/files/test.txt', 'bin/unknown'), :profile => profile) - ContentViewerController.versioning_articles('file1','file2') + blog = Blog.create!(:name => 'A blog test', :profile => profile) + blog.posts << TinyMceArticle.create!( + :name => 'Post1', + :profile => profile, + :parent => blog, + :published => true, + :body => "

This is a bold statement right there!

" + ) + + blog.posts << TinyMceArticle.create!( + :name => 'Post2', + :profile => profile, + :parent => blog, + :published => true, + :body => "

That is a bold statement right there!

" + ) + ContentViewerController.versioning_articles('Post1','Post2') end should 'not display comments marked as spam' do -- libgit2 0.21.2