summaryrefslogtreecommitdiff
path: root/spec/features/projects/forks/fork_list_spec.rb
blob: 2c41c61a660f0673aec93ccff4c6f0a92b3c47a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'spec_helper'

describe 'listing forks of a project' do
  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

  it 'shows the forked project in the list with commit as description' do
    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