diff options
Diffstat (limited to 'test/controllers/page_translations_controller_test.rb')
| -rw-r--r-- | test/controllers/page_translations_controller_test.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/controllers/page_translations_controller_test.rb b/test/controllers/page_translations_controller_test.rb index 82f8bce0..feaacd0e 100644 --- a/test/controllers/page_translations_controller_test.rb +++ b/test/controllers/page_translations_controller_test.rb | |||
| @@ -83,18 +83,15 @@ class PageTranslationsControllerTest < ActionController::TestCase | |||
| 83 | assert_equal "in progress", Globalize.with_locale(:en) { node.autosave.title } | 83 | assert_equal "in progress", Globalize.with_locale(:en) { node.autosave.title } |
| 84 | end | 84 | end |
| 85 | 85 | ||
| 86 | test "destroy logs a translation_destroy NodeAction" do | 86 | test "destroy removes the translation, logs nothing, and redirects" do |
| 87 | login_as :quentin | 87 | login_as :quentin |
| 88 | node = Node.root.children.create!(:slug => "translation_destroy_log_test") | 88 | node = Node.root.children.create!(:slug => "translation_destroy_log_test") |
| 89 | Globalize.with_locale(:en) { node.draft.update!(:title => "English title") } | 89 | Globalize.with_locale(:en) { node.draft.update!(:title => "English title") } |
| 90 | 90 | ||
| 91 | delete :destroy, params: { :node_id => node.id, :translation_locale => "en" } | 91 | assert_no_difference "NodeAction.count" do |
| 92 | delete :destroy, params: { :node_id => node.id, :translation_locale => "en" } | ||
| 93 | end | ||
| 92 | 94 | ||
| 93 | action = NodeAction.last | ||
| 94 | assert_equal node, action.node | ||
| 95 | assert_equal "en", action.locale | ||
| 96 | assert_equal "translation_destroy", action.action | ||
| 97 | assert_equal users(:quentin), action.user | ||
| 98 | assert_redirected_to node_path(node) | 95 | assert_redirected_to node_path(node) |
| 99 | end | 96 | end |
| 100 | end | 97 | end |
