]> git.openstreetmap.org Git - rails.git/blob - test/system/redaction_destroy_test.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / system / redaction_destroy_test.rb
1 # frozen_string_literal: true
2
3 require "application_system_test_case"
4
5 class RedactionDestroyTest < ApplicationSystemTestCase
6   test "fails to delete nonempty redaction" do
7     redaction = create(:redaction, :title => "Some-unwanted-data-redaction")
8     create(:old_node, :redaction => redaction)
9
10     sign_in_as create(:moderator_user)
11     visit redaction_path(redaction)
12     assert_text "Some-unwanted-data-redaction"
13
14     accept_alert do
15       click_on "Remove this redaction"
16     end
17     assert_text "Redaction is not empty"
18     assert_text "Some-unwanted-data-redaction"
19   end
20
21   test "deletes empty redaction" do
22     redaction = create(:redaction, :title => "No-unwanted-data-redaction")
23
24     sign_in_as create(:moderator_user)
25     visit redaction_path(redaction)
26     assert_text "No-unwanted-data-redaction"
27
28     accept_alert do
29       click_on "Remove this redaction"
30     end
31     assert_text "Redaction destroyed"
32     assert_text "List of Redactions"
33     assert_no_text "No-unwanted-data-redaction"
34   end
35 end