diff options
Diffstat (limited to 'test/functional/nodes_controller_test.rb')
| -rw-r--r-- | test/functional/nodes_controller_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/nodes_controller_test.rb b/test/functional/nodes_controller_test.rb index 20090d0..fdeb6cb 100644 --- a/test/functional/nodes_controller_test.rb +++ b/test/functional/nodes_controller_test.rb | |||
| @@ -56,4 +56,24 @@ class NodesControllerTest < ActionController::TestCase | |||
| 56 | assert_equal "Hello", test_node.draft.title | 56 | assert_equal "Hello", test_node.draft.title |
| 57 | assert_equal "There", test_node.draft.body | 57 | assert_equal "There", test_node.draft.body |
| 58 | end | 58 | end |
| 59 | |||
| 60 | def test_update_a_draft_with_changing_the_template | ||
| 61 | test_node = Node.create! :slug => "test_node" | ||
| 62 | test_node.move_to_child_of Node.root | ||
| 63 | |||
| 64 | login_as :quentin | ||
| 65 | put :update, { | ||
| 66 | :id => test_node.id, | ||
| 67 | :page => { | ||
| 68 | :title => "Hello", | ||
| 69 | :body => "There", | ||
| 70 | :template_name => "Foobar" | ||
| 71 | } | ||
| 72 | } | ||
| 73 | |||
| 74 | test_node.reload | ||
| 75 | assert_equal "Hello", test_node.draft.title | ||
| 76 | assert_equal "There", test_node.draft.body | ||
| 77 | assert_equal "Foobar", test_node.draft.template_name | ||
| 78 | end | ||
| 59 | end | 79 | end |
