X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/55bb2437313da9e1628a6c69f7ead6e7946760ab..18409c05ab43a2f818f6db911ae383eb0ebfb07d:/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