X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/55bb2437313da9e1628a6c69f7ead6e7946760ab..90e43e714fbc0e0b50e7403983a53d65fb9f44b6:/test/system/changeset_comments_test.rb diff --git a/test/system/changeset_comments_test.rb b/test/system/changeset_comments_test.rb index 82fd81286..b12aab5ee 100644 --- a/test/system/changeset_comments_test.rb +++ b/test/system/changeset_comments_test.rb @@ -122,4 +122,41 @@ class ChangesetCommentsTest < ApplicationSystemTestCase assert_text "Wanted comment" end end + + test "can subscribe" do + changeset = create(:changeset, :closed) + user = create(:user) + sign_in_as(user) + visit changeset_path(changeset) + + within_sidebar do + assert_button "Subscribe" + assert_no_button "Unsubscribe" + + click_on "Subscribe" + + assert_no_button "Subscribe" + assert_button "Unsubscribe" + end + end + + test "can't subscribe when blocked" do + changeset = create(:changeset, :closed) + user = create(:user) + sign_in_as(user) + visit changeset_path(changeset) + create(:user_block, :user => user) + + within_sidebar do + assert_no_text "Your access to the API has been blocked" + assert_button "Subscribe" + assert_no_button "Unsubscribe" + + click_on "Subscribe" + + assert_text "Your access to the API has been blocked" + assert_button "Subscribe" + assert_no_button "Unsubscribe" + end + end end