提交 21a8cc2c 编写于 作者: J Jan Provaznik

Fix specs failing on duplicate gpg signature

It seems there are additional async requests related to gpg
signature, w/o waiting for finishing all requests it fails on:
Duplicate entry '...' for key 'index_gpg_signatures_on_commit_sha'
上级 91795dcd
......@@ -18,6 +18,7 @@ describe 'Blob shortcuts', :js do
describe 'pressing "y"' do
it 'redirects to permalink with commit sha' do
visit_blob
wait_for_requests
find('body').native.send_key('y')
......@@ -27,6 +28,7 @@ describe 'Blob shortcuts', :js do
it 'maintains fragment hash when redirecting' do
fragment = "L1"
visit_blob(fragment)
wait_for_requests
find('body').native.send_key('y')
......
......@@ -213,6 +213,7 @@ describe "User browses files" do
context "when browsing a file content", :js do
before do
visit(tree_path_root_ref)
wait_for_requests
click_link(".gitignore")
end
......
......@@ -19,6 +19,7 @@ describe 'Projects > Files > User deletes files', :js do
before do
project.add_maintainer(user)
visit(project_tree_path_root_ref)
wait_for_requests
end
it 'deletes the file', :js do
......@@ -35,10 +36,11 @@ describe 'Projects > Files > User deletes files', :js do
end
end
context 'when an user does not have write access' do
context 'when an user does not have write access', :js do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
wait_for_requests
end
it 'deletes the file in a forked project', :js do
......
......@@ -29,13 +29,14 @@ describe 'Projects > Files > User edits files', :js do
end
end
context 'when an user has write access' do
context 'when an user has write access', :js do
before do
project.add_maintainer(user)
visit(project_tree_path_root_ref)
wait_for_requests
end
it 'inserts a content of a file', :js do
it 'inserts a content of a file' do
click_link('.gitignore')
find('.js-edit-blob').click
find('.file-editor', match: :first)
......@@ -49,13 +50,14 @@ describe 'Projects > Files > User edits files', :js do
it 'does not show the edit link if a file is binary' do
binary_file = File.join(project.repository.root_ref, 'files/images/logo-black.png')
visit(project_blob_path(project, binary_file))
wait_for_requests
page.within '.content' do
expect(page).not_to have_link('edit')
end
end
it 'commits an edited file', :js do
it 'commits an edited file' do
click_link('.gitignore')
find('.js-edit-blob').click
find('.file-editor', match: :first)
......@@ -72,7 +74,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_content('*.rbca')
end
it 'commits an edited file to a new branch', :js do
it 'commits an edited file to a new branch' do
click_link('.gitignore')
find('.js-edit-blob').click
......@@ -91,7 +93,7 @@ describe 'Projects > Files > User edits files', :js do
expect(page).to have_content('*.rbca')
end
it 'shows the diff of an edited file', :js do
it 'shows the diff of an edited file' do
click_link('.gitignore')
find('.js-edit-blob').click
find('.file-editor', match: :first)
......@@ -106,13 +108,14 @@ describe 'Projects > Files > User edits files', :js do
it_behaves_like 'unavailable for an archived project'
end
context 'when an user does not have write access' do
context 'when an user does not have write access', :js do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
wait_for_requests
end
it 'inserts a content of a file in a forked project', :js do
it 'inserts a content of a file in a forked project' do
click_link('.gitignore')
find('.js-edit-blob').click
......@@ -134,7 +137,7 @@ describe 'Projects > Files > User edits files', :js do
expect(evaluate_script('ace.edit("editor").getValue()')).to eq('*.rbca')
end
it 'commits an edited file in a forked project', :js do
it 'commits an edited file in a forked project' do
click_link('.gitignore')
find('.js-edit-blob').click
......@@ -163,6 +166,7 @@ describe 'Projects > Files > User edits files', :js do
let!(:forked_project) { fork_project(project2, user, namespace: user.namespace, repository: true) }
before do
visit(project2_tree_path_root_ref)
wait_for_requests
end
it 'links to the forked project for editing' do
......
......@@ -21,9 +21,10 @@ describe 'Projects > Files > User replaces files', :js do
before do
project.add_maintainer(user)
visit(project_tree_path_root_ref)
wait_for_requests
end
it 'replaces an existed file with a new one', :js do
it 'replaces an existed file with a new one' do
click_link('.gitignore')
expect(page).to have_content('.gitignore')
......@@ -47,9 +48,10 @@ describe 'Projects > Files > User replaces files', :js do
before do
project2.add_reporter(user)
visit(project2_tree_path_root_ref)
wait_for_requests
end
it 'replaces an existed file with a new one in a forked project', :js do
it 'replaces an existed file with a new one in a forked project' do
click_link('.gitignore')
expect(page).to have_content('.gitignore')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册