Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 17:34:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 17:34:42 +0300
commit9f46488805e86b1bc341ea1620b866016c2ce5ed (patch)
treef9748c7e287041e37d6da49e0a29c9511dc34768 /spec/features/dashboard
parentdfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff)
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/features/dashboard')
-rw-r--r--spec/features/dashboard/help_spec.rb21
-rw-r--r--spec/features/dashboard/issues_spec.rb2
-rw-r--r--spec/features/dashboard/snippets_spec.rb43
-rw-r--r--spec/features/dashboard/todos/todos_spec.rb42
4 files changed, 40 insertions, 68 deletions
diff --git a/spec/features/dashboard/help_spec.rb b/spec/features/dashboard/help_spec.rb
deleted file mode 100644
index 3f425001447..00000000000
--- a/spec/features/dashboard/help_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe 'Dashboard Help' do
- before do
- sign_in(create(:user))
- end
-
- context 'documentation' do
- it 'renders correctly markdown' do
- visit help_page_path("administration/raketasks/maintenance")
-
- expect(page).to have_content('Gather information about GitLab and the system it runs on')
-
- node = find('.documentation h2 a#user-content-check-gitlab-configuration')
- expect(node[:href]).to eq '#check-gitlab-configuration'
- expect(find(:xpath, "#{node.path}/..").text).to eq 'Check GitLab configuration'
- end
- end
-end
diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb
index ff661014fb9..0b2811618b5 100644
--- a/spec/features/dashboard/issues_spec.rb
+++ b/spec/features/dashboard/issues_spec.rb
@@ -73,7 +73,7 @@ RSpec.describe 'Dashboard Issues' do
find('.new-project-item-link').click
- expect(page).to have_current_path("#{project_path}/issues/new")
+ expect(page).to have_current_path("#{project_path}/-/issues/new")
page.within('#content-body') do
expect(page).to have_selector('.issue-form')
diff --git a/spec/features/dashboard/snippets_spec.rb b/spec/features/dashboard/snippets_spec.rb
index 287af7e7b11..94aef03e093 100644
--- a/spec/features/dashboard/snippets_spec.rb
+++ b/spec/features/dashboard/snippets_spec.rb
@@ -35,7 +35,7 @@ describe 'Dashboard snippets' do
element = page.find('.row.empty-state')
expect(element).to have_content("Code snippets")
- expect(element.find('.svg-content img')['src']).to have_content('illustrations/snippets_empty')
+ expect(element.find('.svg-content img.js-lazy-loaded')['src']).to have_content('illustrations/snippets_empty')
end
it 'shows new snippet button in main content area' do
@@ -49,47 +49,6 @@ describe 'Dashboard snippets' do
end
end
- context 'rendering file names' do
- let_it_be(:snippet) { create(:personal_snippet, :public, author: user, file_name: 'foo.txt') }
- let_it_be(:versioned_snippet) { create(:personal_snippet, :repository, :public, author: user, file_name: 'bar.txt') }
-
- before do
- sign_in(user)
- end
-
- context 'when feature flag :version_snippets is disabled' do
- before do
- stub_feature_flags(version_snippets: false)
-
- visit dashboard_snippets_path
- end
-
- it 'contains the snippet file names from the DB' do
- aggregate_failures do
- expect(page).to have_content 'foo.txt'
- expect(page).to have_content('bar.txt')
- expect(page).not_to have_content('.gitattributes')
- end
- end
- end
-
- context 'when feature flag :version_snippets is enabled' do
- before do
- stub_feature_flags(version_snippets: true)
-
- visit dashboard_snippets_path
- end
-
- it 'contains both the versioned and non-versioned filenames' do
- aggregate_failures do
- expect(page).to have_content 'foo.txt'
- expect(page).to have_content('.gitattributes')
- expect(page).not_to have_content('bar.txt')
- end
- end
- end
- end
-
context 'filtering by visibility' do
let_it_be(:snippets) do
[
diff --git a/spec/features/dashboard/todos/todos_spec.rb b/spec/features/dashboard/todos/todos_spec.rb
index 867281da1e6..63867d5796a 100644
--- a/spec/features/dashboard/todos/todos_spec.rb
+++ b/spec/features/dashboard/todos/todos_spec.rb
@@ -3,10 +3,10 @@
require 'spec_helper'
describe 'Dashboard Todos' do
- let(:user) { create(:user, username: 'john') }
- let(:author) { create(:user) }
- let(:project) { create(:project, :public) }
- let(:issue) { create(:issue, due_date: Date.today, title: "Fix bug") }
+ let_it_be(:user) { create(:user, username: 'john') }
+ let_it_be(:author) { create(:user) }
+ let_it_be(:project) { create(:project, :public) }
+ let_it_be(:issue) { create(:issue, due_date: Date.today, title: "Fix bug") }
context 'User does not have todos' do
before do
@@ -357,4 +357,38 @@ describe 'Dashboard Todos' do
expect(page).to have_link "merge request #{todo.target.to_reference}", href: href
end
end
+
+ context 'User has a todo regarding a design' do
+ let_it_be(:target) { create(:design, issue: issue, project: project) }
+ let_it_be(:note) { create(:note, project: project, note: 'I am note, hear me roar') }
+ let_it_be(:todo) do
+ create(:todo, :mentioned,
+ user: user,
+ project: project,
+ target: target,
+ author: author,
+ note: note)
+ end
+
+ before do
+ project.add_developer(user)
+ sign_in(user)
+
+ visit dashboard_todos_path
+ end
+
+ it 'has todo present' do
+ expect(page).to have_selector('.todos-list .todo', count: 1)
+ end
+
+ it 'has a link that will take me to the design page' do
+ click_link "design #{target.to_reference}"
+
+ expectation = Gitlab::Routing.url_helpers.designs_project_issue_path(
+ target.project, target.issue, target.filename
+ )
+
+ expect(current_path).to eq(expectation)
+ end
+ end
end