Commit f11736019d833651cd49a342bca69d1eef64a4c5
1 parent
0f3a6312
Exists in
master
and in
22 other branches
article-version: implementing testing for feature
AI2822
Showing
2 changed files
with
6 additions
and
4 deletions
Show diff stats
app/controllers/public/content_viewer_controller.rb
| ... | ... | @@ -120,6 +120,10 @@ 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) | |
| 125 | + end | |
| 126 | + | |
| 123 | 127 | protected |
| 124 | 128 | |
| 125 | 129 | def per_page |
| ... | ... | @@ -152,8 +156,6 @@ class ContentViewerController < ApplicationController |
| 152 | 156 | |
| 153 | 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 | 1195 | end |
| 1196 | 1196 | |
| 1197 | 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 | 1199 | end |
| 1200 | 1200 | |
| 1201 | 1201 | should 'not display comments marked as spam' do | ... | ... |