Commit 1dc8a831 authored by Etienne Baqué's avatar Etienne Baqué

Merge branch '331906_fix_tests_for_the_rest' into 'master'

Update tests to simplify default branch migration

See merge request gitlab-org/gitlab!65556
parents c0224f12 0e993a42
......@@ -7,10 +7,12 @@ RSpec.describe 'User views an empty project' do
let_it_be(:user) { create(:user) }
shared_examples 'allowing push to default branch' do
it 'shows push-to-master instructions' do
let(:default_branch) { project.default_branch_or_main }
it 'shows push-to-default-branch instructions' do
visit project_path(project)
expect(page).to have_content('git push -u origin master')
expect(page).to have_content("git push -u origin #{default_branch}")
end
end
......@@ -47,7 +49,7 @@ RSpec.describe 'User views an empty project' do
it 'does not show push-to-master instructions' do
visit project_path(project)
expect(page).not_to have_content('git push -u origin master')
expect(page).not_to have_content('git push -u origin')
end
end
end
......@@ -61,7 +63,7 @@ RSpec.describe 'User views an empty project' do
it 'does not show push-to-master instructions nor invite members link', :aggregate_failures, :js do
visit project_path(project)
expect(page).not_to have_content('git push -u origin master')
expect(page).not_to have_content('git push -u origin')
expect(page).not_to have_button(text: 'Invite members')
end
end
......
......@@ -611,11 +611,12 @@ RSpec.describe API::Wikis do
let(:payload) { { file: fixture_file_upload('spec/fixtures/dk.png') } }
let(:url) { "/projects/#{project.id}/wikis/attachments" }
let(:file_path) { "#{Wikis::CreateAttachmentService::ATTACHMENT_PATH}/fixed_hex/dk.png" }
let(:branch) { wiki.default_branch }
let(:result_hash) do
{
file_name: 'dk.png',
file_path: file_path,
branch: 'master',
branch: branch,
link: {
url: file_path,
markdown: "![dk](#{file_path})"
......
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