Commit f11736019d833651cd49a342bca69d1eef64a4c5

Authored by Junior Silva
1 parent 0f3a6312

article-version: implementing testing for feature

AI2822
app/controllers/public/content_viewer_controller.rb
@@ -120,6 +120,10 @@ class ContentViewerController < ApplicationController @@ -120,6 +120,10 @@ class ContentViewerController < ApplicationController
120 end 120 end
121 end 121 end
122 122
  123 + def self.versioning_articles(article1, article2)
  124 + Diffy::Diff.new('article1', 'article2', :source => 'files').to_s(:html)
  125 + end
  126 +
123 protected 127 protected
124 128
125 def per_page 129 def per_page
@@ -152,8 +156,6 @@ class ContentViewerController < ApplicationController @@ -152,8 +156,6 @@ class ContentViewerController < ApplicationController
152 156
153 end 157 end
154 158
155 - def versioning_articles(article1, article2)  
156 - Diffy::Diff.new('article1', 'article2', :source => 'files').to_s(:html)  
157 - end 159 +
158 160
159 161
test/functional/content_viewer_controller_test.rb
@@ -1195,7 +1195,7 @@ class ContentViewerControllerTest < ActionController::TestCase @@ -1195,7 +1195,7 @@ class ContentViewerControllerTest < ActionController::TestCase
1195 end 1195 end
1196 1196
1197 should 'display differences between article versions' do 1197 should 'display differences between article versions' do
1198 - Article.versioning_articles('/files/test.txt','/files/test.txt') 1198 + ContentViewerController.versioning_articles('/files/test.txt','/files/test.txt')
1199 end 1199 end
1200 1200
1201 should 'not display comments marked as spam' do 1201 should 'not display comments marked as spam' do