diff options
| author | hukl <contact@smyck.org> | 2009-11-02 22:19:32 +0100 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-11-02 22:19:32 +0100 |
| commit | 3b35b3a0bba7991a243eb794303b838ae90bb69c (patch) | |
| tree | 604095eff2e87d2c9b201514ab3d931f73a45c43 /test/functional | |
| parent | bebbe35c5b0c26d1d8f75fa98f239e41f2aee054 (diff) | |
add tests
Diffstat (limited to 'test/functional')
| -rw-r--r-- | test/functional/nodes_controller_test.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/functional/nodes_controller_test.rb b/test/functional/nodes_controller_test.rb index 8710c0b..4088986 100644 --- a/test/functional/nodes_controller_test.rb +++ b/test/functional/nodes_controller_test.rb | |||
| @@ -283,7 +283,31 @@ class NodesControllerTest < ActionController::TestCase | |||
| 283 | put :update, :id => node.id, :page => {:user_id => users(:aaron).id} | 283 | put :update, :id => node.id, :page => {:user_id => users(:aaron).id} |
| 284 | assert_response :redirect | 284 | assert_response :redirect |
| 285 | assert_equal "aaron", node.reload.draft.user.login | 285 | assert_equal "aaron", node.reload.draft.user.login |
| 286 | 286 | end | |
| 287 | |||
| 288 | test "updating an existing page should not modify published_at" do | ||
| 289 | login_as :quentin | ||
| 290 | Node.root.descendants.destroy_all | ||
| 291 | node = create_node_with_published_page | ||
| 292 | |||
| 293 | get :edit, :id => node.id | ||
| 294 | assert_response :success | ||
| 287 | 295 | ||
| 296 | put :publish, :id => node.id | ||
| 297 | |||
| 298 | node.reload | ||
| 299 | assert_equal node.pages[0].published_at, node.pages[1].published_at | ||
| 300 | end | ||
| 301 | |||
| 302 | test "updating an exisiting page should not alter the author" do | ||
| 303 | login_as :aaron | ||
| 304 | Node.root.descendants.destroy_all | ||
| 305 | node = create_node_with_published_page | ||
| 306 | get :edit, :id => node.id | ||
| 307 | |||
| 308 | put :publish, :id => node.id | ||
| 309 | |||
| 310 | node.reload | ||
| 311 | assert_equal node.pages[0].user, node.pages[1].user | ||
| 288 | end | 312 | end |
| 289 | end | 313 | end |
