diff options
Diffstat (limited to 'test/controllers/revisions_controller_test.rb')
| -rw-r--r-- | test/controllers/revisions_controller_test.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/controllers/revisions_controller_test.rb b/test/controllers/revisions_controller_test.rb index b4dcd8f..e2fc976 100644 --- a/test/controllers/revisions_controller_test.rb +++ b/test/controllers/revisions_controller_test.rb | |||
| @@ -59,4 +59,33 @@ class RevisionsControllerTest < ActionController::TestCase | |||
| 59 | assert_equal @node.head, @node.pages.first | 59 | assert_equal @node.head, @node.pages.first |
| 60 | assert_equal "first", @node.head.reload.body | 60 | assert_equal "first", @node.head.reload.body |
| 61 | end | 61 | end |
| 62 | |||
| 63 | test "diffing two revisions renders real markup with only the changed words marked" do | ||
| 64 | login_as :quentin | ||
| 65 | post( | ||
| 66 | :diff, params: { | ||
| 67 | :node_id => @node.id, | ||
| 68 | :start_revision => @node.pages.first.revision, | ||
| 69 | :end_revision => @node.pages.last.revision | ||
| 70 | } | ||
| 71 | ) | ||
| 72 | assert_response :success | ||
| 73 | assert_select "del", "first" | ||
| 74 | assert_select "ins", "second" | ||
| 75 | assert_no_match /</, response.body | ||
| 76 | end | ||
| 77 | |||
| 78 | test "diffing two revisions in side by side view renders two columns" do | ||
| 79 | login_as :quentin | ||
| 80 | post( | ||
| 81 | :diff, params: { | ||
| 82 | :node_id => @node.id, | ||
| 83 | :start_revision => @node.pages.first.revision, | ||
| 84 | :end_revision => @node.pages.last.revision, | ||
| 85 | :view => "side_by_side" | ||
| 86 | } | ||
| 87 | ) | ||
| 88 | assert_response :success | ||
| 89 | assert_select ".diff_column", 2 | ||
| 90 | end | ||
| 62 | end | 91 | end |
