Update rubocop-capybara to version 2.19.0 (#26982)
				
					
				
			This commit is contained in:
		@@ -634,7 +634,7 @@ GEM
 | 
			
		||||
      unicode-display_width (>= 2.4.0, < 3.0)
 | 
			
		||||
    rubocop-ast (1.29.0)
 | 
			
		||||
      parser (>= 3.2.1.0)
 | 
			
		||||
    rubocop-capybara (2.18.0)
 | 
			
		||||
    rubocop-capybara (2.19.0)
 | 
			
		||||
      rubocop (~> 1.41)
 | 
			
		||||
    rubocop-factory_bot (2.23.1)
 | 
			
		||||
      rubocop (~> 1.33)
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ describe 'blocking domains through the moderation interface' do
 | 
			
		||||
 | 
			
		||||
      fill_in 'domain_block_domain', with: 'example.com'
 | 
			
		||||
      select I18n.t('admin.domain_blocks.new.severity.silence'), from: 'domain_block_severity'
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
 | 
			
		||||
      expect(DomainBlock.exists?(domain: 'example.com', severity: 'silence')).to be true
 | 
			
		||||
    end
 | 
			
		||||
@@ -25,13 +25,13 @@ describe 'blocking domains through the moderation interface' do
 | 
			
		||||
 | 
			
		||||
      fill_in 'domain_block_domain', with: 'example.com'
 | 
			
		||||
      select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity'
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
 | 
			
		||||
      # It presents a confirmation screen
 | 
			
		||||
      expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'example.com'))
 | 
			
		||||
 | 
			
		||||
      # Confirming creates a block
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
 | 
			
		||||
      expect(DomainBlock.exists?(domain: 'example.com', severity: 'suspend')).to be true
 | 
			
		||||
    end
 | 
			
		||||
@@ -45,13 +45,13 @@ describe 'blocking domains through the moderation interface' do
 | 
			
		||||
 | 
			
		||||
      fill_in 'domain_block_domain', with: 'example.com'
 | 
			
		||||
      select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity'
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
 | 
			
		||||
      # It presents a confirmation screen
 | 
			
		||||
      expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'example.com'))
 | 
			
		||||
 | 
			
		||||
      # Confirming updates the block
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
 | 
			
		||||
      expect(domain_block.reload.severity).to eq 'suspend'
 | 
			
		||||
    end
 | 
			
		||||
@@ -65,13 +65,13 @@ describe 'blocking domains through the moderation interface' do
 | 
			
		||||
 | 
			
		||||
      fill_in 'domain_block_domain', with: 'subdomain.example.com'
 | 
			
		||||
      select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity'
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.new.create')
 | 
			
		||||
 | 
			
		||||
      # It presents a confirmation screen
 | 
			
		||||
      expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'subdomain.example.com'))
 | 
			
		||||
 | 
			
		||||
      # Confirming creates the block
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
 | 
			
		||||
      expect(DomainBlock.where(domain: 'subdomain.example.com', severity: 'suspend')).to exist
 | 
			
		||||
 | 
			
		||||
@@ -88,13 +88,13 @@ describe 'blocking domains through the moderation interface' do
 | 
			
		||||
      visit edit_admin_domain_block_path(domain_block)
 | 
			
		||||
 | 
			
		||||
      select I18n.t('admin.domain_blocks.new.severity.suspend'), from: 'domain_block_severity'
 | 
			
		||||
      click_on I18n.t('generic.save_changes')
 | 
			
		||||
      click_button I18n.t('generic.save_changes')
 | 
			
		||||
 | 
			
		||||
      # It presents a confirmation screen
 | 
			
		||||
      expect(page).to have_title(I18n.t('admin.domain_blocks.confirm_suspension.title', domain: 'example.com'))
 | 
			
		||||
 | 
			
		||||
      # Confirming updates the block
 | 
			
		||||
      click_on I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
      click_button I18n.t('admin.domain_blocks.confirm_suspension.confirm')
 | 
			
		||||
 | 
			
		||||
      expect(domain_block.reload.severity).to eq 'suspend'
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
@@ -11,13 +11,13 @@ describe 'finding software updates through the admin interface' do
 | 
			
		||||
 | 
			
		||||
  it 'shows a link to the software updates page, which links to release notes' do
 | 
			
		||||
    visit settings_profile_path
 | 
			
		||||
    click_on I18n.t('admin.critical_update_pending')
 | 
			
		||||
    click_link I18n.t('admin.critical_update_pending')
 | 
			
		||||
 | 
			
		||||
    expect(page).to have_title(I18n.t('admin.software_updates.title'))
 | 
			
		||||
 | 
			
		||||
    expect(page).to have_content('99.99.99')
 | 
			
		||||
 | 
			
		||||
    click_on I18n.t('admin.software_updates.release_notes')
 | 
			
		||||
    click_link I18n.t('admin.software_updates.release_notes')
 | 
			
		||||
    expect(page).to have_current_path('https://github.com/mastodon/mastodon/releases/v99', url: true)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@ describe 'email confirmation flow when captcha is enabled' do
 | 
			
		||||
      expect(user.reload.confirmed?).to be false
 | 
			
		||||
 | 
			
		||||
      # It redirects to app and confirms user
 | 
			
		||||
      click_on I18n.t('challenge.confirm')
 | 
			
		||||
      click_button I18n.t('challenge.confirm')
 | 
			
		||||
      expect(user.reload.confirmed?).to be true
 | 
			
		||||
      expect(page).to have_current_path(/\A#{client_app.confirmation_redirect_uri}/, url: true)
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ describe 'Log in' do
 | 
			
		||||
  it 'A valid email and password user is able to log in' do
 | 
			
		||||
    fill_in 'user_email', with: email
 | 
			
		||||
    fill_in 'user_password', with: password
 | 
			
		||||
    click_on I18n.t('auth.login')
 | 
			
		||||
    click_button I18n.t('auth.login')
 | 
			
		||||
 | 
			
		||||
    expect(subject).to have_css('div.app-holder')
 | 
			
		||||
  end
 | 
			
		||||
@@ -27,7 +27,7 @@ describe 'Log in' do
 | 
			
		||||
  it 'A invalid email and password user is not able to log in' do
 | 
			
		||||
    fill_in 'user_email', with: 'invalid_email'
 | 
			
		||||
    fill_in 'user_password', with: 'invalid_password'
 | 
			
		||||
    click_on I18n.t('auth.login')
 | 
			
		||||
    click_button I18n.t('auth.login')
 | 
			
		||||
 | 
			
		||||
    expect(subject).to have_css('.flash-message', text: failure_message('invalid'))
 | 
			
		||||
  end
 | 
			
		||||
@@ -38,7 +38,7 @@ describe 'Log in' do
 | 
			
		||||
    it 'A unconfirmed user is able to log in' do
 | 
			
		||||
      fill_in 'user_email', with: email
 | 
			
		||||
      fill_in 'user_password', with: password
 | 
			
		||||
      click_on I18n.t('auth.login')
 | 
			
		||||
      click_button I18n.t('auth.login')
 | 
			
		||||
 | 
			
		||||
      expect(subject).to have_css('div.admin-wrapper')
 | 
			
		||||
    end
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,7 @@ describe 'Using OAuth from an external app' do
 | 
			
		||||
      expect(page).to have_content(I18n.t('doorkeeper.authorizations.buttons.authorize'))
 | 
			
		||||
 | 
			
		||||
      # Upon authorizing, it redirects to the apps' callback URL
 | 
			
		||||
      click_on I18n.t('doorkeeper.authorizations.buttons.authorize')
 | 
			
		||||
      click_button I18n.t('doorkeeper.authorizations.buttons.authorize')
 | 
			
		||||
      expect(page).to have_current_path(/\A#{client_app.redirect_uri}/, url: true)
 | 
			
		||||
 | 
			
		||||
      # It grants the app access to the account
 | 
			
		||||
@@ -35,7 +35,7 @@ describe 'Using OAuth from an external app' do
 | 
			
		||||
      expect(page).to have_content(I18n.t('doorkeeper.authorizations.buttons.deny'))
 | 
			
		||||
 | 
			
		||||
      # Upon denying, it redirects to the apps' callback URL
 | 
			
		||||
      click_on I18n.t('doorkeeper.authorizations.buttons.deny')
 | 
			
		||||
      click_button I18n.t('doorkeeper.authorizations.buttons.deny')
 | 
			
		||||
      expect(page).to have_current_path(/\A#{client_app.redirect_uri}/, url: true)
 | 
			
		||||
 | 
			
		||||
      # It does not grant the app access to the account
 | 
			
		||||
@@ -63,17 +63,17 @@ describe 'Using OAuth from an external app' do
 | 
			
		||||
      # Failing to log-in presents the form again
 | 
			
		||||
      fill_in 'user_email', with: email
 | 
			
		||||
      fill_in 'user_password', with: 'wrong password'
 | 
			
		||||
      click_on I18n.t('auth.login')
 | 
			
		||||
      click_button I18n.t('auth.login')
 | 
			
		||||
      expect(page).to have_content(I18n.t('auth.login'))
 | 
			
		||||
 | 
			
		||||
      # Logging in redirects to an authorization page
 | 
			
		||||
      fill_in 'user_email', with: email
 | 
			
		||||
      fill_in 'user_password', with: password
 | 
			
		||||
      click_on I18n.t('auth.login')
 | 
			
		||||
      click_button I18n.t('auth.login')
 | 
			
		||||
      expect(page).to have_content(I18n.t('doorkeeper.authorizations.buttons.authorize'))
 | 
			
		||||
 | 
			
		||||
      # Upon authorizing, it redirects to the apps' callback URL
 | 
			
		||||
      click_on I18n.t('doorkeeper.authorizations.buttons.authorize')
 | 
			
		||||
      click_button I18n.t('doorkeeper.authorizations.buttons.authorize')
 | 
			
		||||
      expect(page).to have_current_path(/\A#{client_app.redirect_uri}/, url: true)
 | 
			
		||||
 | 
			
		||||
      # It grants the app access to the account
 | 
			
		||||
@@ -90,17 +90,17 @@ describe 'Using OAuth from an external app' do
 | 
			
		||||
      # Failing to log-in presents the form again
 | 
			
		||||
      fill_in 'user_email', with: email
 | 
			
		||||
      fill_in 'user_password', with: 'wrong password'
 | 
			
		||||
      click_on I18n.t('auth.login')
 | 
			
		||||
      click_button I18n.t('auth.login')
 | 
			
		||||
      expect(page).to have_content(I18n.t('auth.login'))
 | 
			
		||||
 | 
			
		||||
      # Logging in redirects to an authorization page
 | 
			
		||||
      fill_in 'user_email', with: email
 | 
			
		||||
      fill_in 'user_password', with: password
 | 
			
		||||
      click_on I18n.t('auth.login')
 | 
			
		||||
      click_button I18n.t('auth.login')
 | 
			
		||||
      expect(page).to have_content(I18n.t('doorkeeper.authorizations.buttons.authorize'))
 | 
			
		||||
 | 
			
		||||
      # Upon denying, it redirects to the apps' callback URL
 | 
			
		||||
      click_on I18n.t('doorkeeper.authorizations.buttons.deny')
 | 
			
		||||
      click_button I18n.t('doorkeeper.authorizations.buttons.deny')
 | 
			
		||||
      expect(page).to have_current_path(/\A#{client_app.redirect_uri}/, url: true)
 | 
			
		||||
 | 
			
		||||
      # It does not grant the app access to the account
 | 
			
		||||
@@ -120,27 +120,27 @@ describe 'Using OAuth from an external app' do
 | 
			
		||||
        # Failing to log-in presents the form again
 | 
			
		||||
        fill_in 'user_email', with: email
 | 
			
		||||
        fill_in 'user_password', with: 'wrong password'
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('auth.login'))
 | 
			
		||||
 | 
			
		||||
        # Logging in redirects to a two-factor authentication page
 | 
			
		||||
        fill_in 'user_email', with: email
 | 
			
		||||
        fill_in 'user_password', with: password
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp'))
 | 
			
		||||
 | 
			
		||||
        # Filling in an incorrect two-factor authentication code presents the form again
 | 
			
		||||
        fill_in 'user_otp_attempt', with: 'wrong'
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp'))
 | 
			
		||||
 | 
			
		||||
        # Filling in the correct TOTP code redirects to an app authorization page
 | 
			
		||||
        fill_in 'user_otp_attempt', with: user.current_otp
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('doorkeeper.authorizations.buttons.authorize'))
 | 
			
		||||
 | 
			
		||||
        # Upon authorizing, it redirects to the apps' callback URL
 | 
			
		||||
        click_on I18n.t('doorkeeper.authorizations.buttons.authorize')
 | 
			
		||||
        click_button I18n.t('doorkeeper.authorizations.buttons.authorize')
 | 
			
		||||
        expect(page).to have_current_path(/\A#{client_app.redirect_uri}/, url: true)
 | 
			
		||||
 | 
			
		||||
        # It grants the app access to the account
 | 
			
		||||
@@ -157,27 +157,27 @@ describe 'Using OAuth from an external app' do
 | 
			
		||||
        # Failing to log-in presents the form again
 | 
			
		||||
        fill_in 'user_email', with: email
 | 
			
		||||
        fill_in 'user_password', with: 'wrong password'
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('auth.login'))
 | 
			
		||||
 | 
			
		||||
        # Logging in redirects to a two-factor authentication page
 | 
			
		||||
        fill_in 'user_email', with: email
 | 
			
		||||
        fill_in 'user_password', with: password
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp'))
 | 
			
		||||
 | 
			
		||||
        # Filling in an incorrect two-factor authentication code presents the form again
 | 
			
		||||
        fill_in 'user_otp_attempt', with: 'wrong'
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('simple_form.hints.sessions.otp'))
 | 
			
		||||
 | 
			
		||||
        # Filling in the correct TOTP code redirects to an app authorization page
 | 
			
		||||
        fill_in 'user_otp_attempt', with: user.current_otp
 | 
			
		||||
        click_on I18n.t('auth.login')
 | 
			
		||||
        click_button I18n.t('auth.login')
 | 
			
		||||
        expect(page).to have_content(I18n.t('doorkeeper.authorizations.buttons.authorize'))
 | 
			
		||||
 | 
			
		||||
        # Upon denying, it redirects to the apps' callback URL
 | 
			
		||||
        click_on I18n.t('doorkeeper.authorizations.buttons.deny')
 | 
			
		||||
        click_button I18n.t('doorkeeper.authorizations.buttons.deny')
 | 
			
		||||
        expect(page).to have_current_path(/\A#{client_app.redirect_uri}/, url: true)
 | 
			
		||||
 | 
			
		||||
        # It does not grant the app access to the account
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,7 @@ module ProfileStories
 | 
			
		||||
    visit new_user_session_path
 | 
			
		||||
    fill_in 'user_email', with: email
 | 
			
		||||
    fill_in 'user_password', with: password
 | 
			
		||||
    click_on I18n.t('auth.login')
 | 
			
		||||
    click_button I18n.t('auth.login')
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def with_alice_as_local_user
 | 
			
		||||
 
 | 
			
		||||
@@ -24,10 +24,10 @@ describe 'NewStatuses' do
 | 
			
		||||
 | 
			
		||||
    within('.compose-form') do
 | 
			
		||||
      fill_in "What's on your mind?", with: status_text
 | 
			
		||||
      click_on 'Publish!'
 | 
			
		||||
      click_button 'Publish!'
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    expect(subject).to have_selector('.status__content__text', text: status_text)
 | 
			
		||||
    expect(subject).to have_css('.status__content__text', text: status_text)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it 'can be posted again' do
 | 
			
		||||
@@ -37,9 +37,9 @@ describe 'NewStatuses' do
 | 
			
		||||
 | 
			
		||||
    within('.compose-form') do
 | 
			
		||||
      fill_in "What's on your mind?", with: status_text
 | 
			
		||||
      click_on 'Publish!'
 | 
			
		||||
      click_button 'Publish!'
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    expect(subject).to have_selector('.status__content__text', text: status_text)
 | 
			
		||||
    expect(subject).to have_css('.status__content__text', text: status_text)
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user