Commit db396d5b authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '25614-transient-failure' into 'master'

Improve spec for resetting incoming email token

Closes #25614

See merge request !8296
parents 5866f7b3 65322905
...@@ -371,23 +371,25 @@ describe 'Issues', feature: true do ...@@ -371,23 +371,25 @@ describe 'Issues', feature: true do
describe 'when I want to reset my incoming email token' do describe 'when I want to reset my incoming email token' do
let(:project1) { create(:project, namespace: @user.namespace) } let(:project1) { create(:project, namespace: @user.namespace) }
let(:issue) { create(:issue, project: project1) } let!(:issue) { create(:issue, project: project1) }
before do before do
allow(Gitlab.config.incoming_email).to receive(:enabled).and_return(true) stub_incoming_email_setting(enabled: true, address: "p+%{key}@gl.ab")
project1.team << [@user, :master] project1.team << [@user, :master]
project1.issues << issue
visit namespace_project_issues_path(@user.namespace, project1) visit namespace_project_issues_path(@user.namespace, project1)
end end
it 'changes incoming email address token', js: true do it 'changes incoming email address token', js: true do
find('.issue-email-modal-btn').click find('.issue-email-modal-btn').click
previous_token = find('input#issue_email').value previous_token = find('input#issue_email').value
find('.incoming-email-token-reset').click find('.incoming-email-token-reset').click
wait_for_ajax
expect(find('input#issue_email').value).not_to eq(previous_token) expect(page).to have_no_field('issue_email', with: previous_token)
new_token = project1.new_issue_address(@user.reload)
expect(page).to have_field(
'issue_email',
with: new_token
)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment