2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-04-06 08:40:33 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Projects > Show > User sees README' do
|
2020-02-26 13:09:24 -05:00
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:project) { create(:project, :repository, :public) }
|
2018-04-06 08:40:33 -04:00
|
|
|
|
|
|
|
it 'shows the project README', :js do
|
|
|
|
visit project_path(project)
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
page.within('.readme-holder') do
|
|
|
|
expect(page).to have_content 'testme'
|
|
|
|
end
|
|
|
|
end
|
2020-09-15 20:09:37 -04:00
|
|
|
|
|
|
|
context 'obeying robots.txt' do
|
|
|
|
before do
|
|
|
|
Gitlab::Testing::RobotsBlockerMiddleware.block_requests!
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
Gitlab::Testing::RobotsBlockerMiddleware.allow_requests!
|
|
|
|
end
|
|
|
|
|
|
|
|
# For example, see this regression we had in
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39520
|
|
|
|
it 'does not block the requests necessary to load the project README', :js do
|
|
|
|
visit project_path(project)
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
page.within('.readme-holder') do
|
|
|
|
expect(page).to have_content 'testme'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-04-06 08:40:33 -04:00
|
|
|
end
|