2019-07-25 05:24:42 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-04-09 15:38:58 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 18:09:01 +00:00
|
|
|
RSpec.describe 'listing forks of a project' do
|
2019-04-09 15:38:58 +00:00
|
|
|
include ProjectForksHelper
|
|
|
|
include ExternalAuthorizationServiceHelpers
|
|
|
|
|
|
|
|
let(:source) { create(:project, :public, :repository) }
|
|
|
|
let!(:fork) { fork_project(source, nil, repository: true) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
source.add_maintainer(user)
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
2019-10-23 09:06:03 +00:00
|
|
|
it 'shows the forked project in the list with commit as description', :sidekiq_might_not_need_inline do
|
2019-04-09 15:38:58 +00:00
|
|
|
visit project_forks_path(source)
|
|
|
|
|
|
|
|
page.within('li.project-row') do
|
|
|
|
expect(page).to have_content(fork.full_name)
|
|
|
|
expect(page).to have_css('a.commit-row-message')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show the commit message when an external authorization service is used' do
|
|
|
|
enable_external_authorization_service_check
|
|
|
|
|
|
|
|
visit project_forks_path(source)
|
|
|
|
|
|
|
|
page.within('li.project-row') do
|
|
|
|
expect(page).to have_content(fork.full_name)
|
|
|
|
expect(page).not_to have_css('a.commit-row-message')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|