<commit_before>include Warden::Test::Helpers
Warden.test_mode!

feature 'User delete', :devise, :js do
  after(:each) do
    Warden.test_reset!
  end

  let(:user) { FactoryGirl.create(:user).tap(&:confirm) }

  scenario 'user can delete his own account' do
    login_as user, scope: :user, run_callbacks: false
    visit edit_user_registration_path(user)
    # TODO: Figure out how the captions can be fetched by I18n.t and client and server having the same language set.
    #       Replace last expect by proper feature style test with sign_in and test for error message.
    page.accept_confirm do
      click_button 'Mein Benutzerkonto löschen'
    end
    expect(User.find_by_id(user.id)).to be_nil
  end
end<commit_msg>Fix test to pass on Semaphore<commit_after>include Warden::Test::Helpers
Warden.test_mode!

feature 'User delete', :devise, :js do
  after(:each) do
    Warden.test_reset!
  end

  let(:user) { FactoryGirl.create(:user).tap(&:confirm) }

  scenario 'user can delete his own account' do
    login_as user, scope: :user, run_callbacks: false
    visit edit_user_registration_path(user)
    page.accept_confirm do
      click_button I18n.t('views.devise.registrations.edit.cancel_button')
    end
    expect(User.find_by_id(user.id)).to be_nil
  end
end
{'fraction_non_alphanumeric': 0.0932601880877743, 'fraction_numerical': 0.003134796238244514, 'mean_word_length': 4.087649402390438, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5757020', 'n_tokens_mistral': 427, 'n_tokens_neox': 417, 'n_words': 121}