summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/controllers/revisions_controller_test.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/controllers/revisions_controller_test.rb b/test/controllers/revisions_controller_test.rb
index e2fc976..46fc220 100644
--- a/test/controllers/revisions_controller_test.rb
+++ b/test/controllers/revisions_controller_test.rb
@@ -28,21 +28,33 @@ class RevisionsControllerTest < ActionController::TestCase
28 assert_response :success 28 assert_response :success
29 assert_select ".revision", 2 29 assert_select ".revision", 2
30 end 30 end
31 31
32 test "showing one revision" do 32 test "showing one revision" do
33 login_as :quentin 33 login_as :quentin
34 get :show, params: { :node_id => @node.id, :id => @node.pages.last.id } 34 get :show, params: { :node_id => @node.id, :id => @node.pages.last.id }
35 assert_response :success 35 assert_response :success
36 assert_select "strong", "Body" 36 assert_select ".node_description", "Body"
37 assert_select "td", {:count => 1, :text => "second"} 37 assert_select ".node_content", {:count => 1, :text => "second"}
38 end 38 end
39 39
40 test "showing a revision renders real markup in the body, not escaped entities" do
41 login_as :quentin
42 node = Node.root.children.create!(:slug => "show_markup_test")
43 draft = node.draft
44 draft.body = "<h3>Hello</h3>"
45 node.publish_draft!
46
47 get :show, params: { :node_id => node.id, :id => node.head.id }
48 assert_response :success
49 assert_select ".node_content h3", "Hello"
50 end
51
40 test "diffing two revisions" do 52 test "diffing two revisions" do
41 login_as :quentin 53 login_as :quentin
42 post( 54 post(
43 :diff, params: { 55 :diff, params: {
44 :node_id => @node.id, 56 :node_id => @node.id,
45 :start_revision => @node.pages.first.revision, 57 :start_revision => @node.pages.first.revision,
46 :end_revision => @node.pages.last.revision 58 :end_revision => @node.pages.last.revision
47 } 59 }
48 ) 60 )