2020-07-28 23:09:34 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'User views the Confluence page' do
|
|
|
|
let_it_be(:user) { create(:user) }
|
2021-06-08 01:23:25 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
let(:project) { create(:project, :public) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'shows the page when the Confluence integration is enabled' do
|
2021-09-04 01:27:46 +05:30
|
|
|
service = create(:confluence_integration, project: project)
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
visit project_wikis_confluence_path(project)
|
|
|
|
|
2021-12-11 22:18:48 +05:30
|
|
|
expect(page).to have_css('.nav-sidebar li.active', text: 'Confluence', match: :first)
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
element = page.find('.row.empty-state')
|
|
|
|
|
|
|
|
expect(element).to have_link('Go to Confluence', href: service.confluence_url)
|
2021-12-11 22:18:48 +05:30
|
|
|
expect(element).to have_link('Confluence epic', href: 'https://gitlab.com/groups/gitlab-org/-/epics/3629')
|
2020-07-28 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not show the page when the Confluence integration disabled' do
|
|
|
|
visit project_wikis_confluence_path(project)
|
|
|
|
|
|
|
|
expect(page).to have_gitlab_http_status(:not_found)
|
|
|
|
end
|
|
|
|
end
|