X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/25e4a80760d29d6026df5b5fa3f2ac121dcfe957..bb561d3ea9441b9a1c9032a80d751b640ddd2a23:/test/system/resolve_note_test.rb diff --git a/test/system/resolve_note_test.rb b/test/system/resolve_note_test.rb index f9152d99b..7f47e45e2 100644 --- a/test/system/resolve_note_test.rb +++ b/test/system/resolve_note_test.rb @@ -57,4 +57,50 @@ class ResolveNoteTest < ApplicationSystemTestCase assert_no_content " user) + + within_sidebar do + assert_text "Unresolved note" + assert_no_text "Resolved note" + assert_no_text "Your access to the API has been blocked" + assert_button "Resolve", :disabled => false + assert_button "Comment", :disabled => true + + click_on "Resolve" + + assert_text "Unresolved note" + assert_no_text "Resolved note" + assert_text "Your access to the API has been blocked" + assert_button "Resolve", :disabled => false + assert_button "Comment", :disabled => true + end + end + + test "can't reactivate a note when blocked" do + note = create(:note_with_comments, :closed) + user = create(:user) + sign_in_as(user) + visit note_path(note) + create(:user_block, :user => user) + + within_sidebar do + assert_no_text "Unresolved note" + assert_text "Resolved note" + assert_no_text "Your access to the API has been blocked" + assert_button "Reactivate", :disabled => false + + click_on "Reactivate" + + assert_no_text "Unresolved note" + assert_text "Resolved note" + assert_text "Your access to the API has been blocked" + assert_button "Reactivate", :disabled => false + end + end end