diff options
Diffstat (limited to 'test/controllers/admin_controller_test.rb')
| -rw-r--r-- | test/controllers/admin_controller_test.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/controllers/admin_controller_test.rb b/test/controllers/admin_controller_test.rb index 9bbf29b..d6005ba 100644 --- a/test/controllers/admin_controller_test.rb +++ b/test/controllers/admin_controller_test.rb | |||
| @@ -1,8 +1,17 @@ | |||
| 1 | require 'test_helper' | 1 | require 'test_helper' |
| 2 | 2 | ||
| 3 | class AdminControllerTest < ActionController::TestCase | 3 | class AdminControllerTest < ActionController::TestCase |
| 4 | # Replace this with your real tests. | 4 | test "current drafts includes nodes with only an autosave" do |
| 5 | test "the truth" do | 5 | node = Node.root.children.create!(:slug => "admin_autosave_only") |
| 6 | assert true | 6 | node.lock_for_editing!(User.find_by_login("aaron")) |
| 7 | node.autosave!({title: "in progress"}, User.find_by_login("aaron")) | ||
| 8 | node.save_draft!(User.find_by_login("aaron")) | ||
| 9 | node.publish_draft! | ||
| 10 | node.lock_for_editing!(User.find_by_login("aaron")) | ||
| 11 | node.autosave!({title: "editing again"}, User.find_by_login("aaron")) | ||
| 12 | |||
| 13 | login_as :quentin | ||
| 14 | get :index | ||
| 15 | assert_includes assigns(:drafts), node | ||
| 7 | end | 16 | end |
| 8 | end | 17 | end |
