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:
Diffstat (limited to 'spec/features/projects/blobs')
-rw-r--r--spec/features/projects/blobs/blame_spec.rb2
-rw-r--r--spec/features/projects/blobs/blob_line_permalink_updater_spec.rb2
-rw-r--r--spec/features/projects/blobs/blob_show_spec.rb62
-rw-r--r--spec/features/projects/blobs/edit_spec.rb55
-rw-r--r--spec/features/projects/blobs/shortcuts_blob_spec.rb2
-rw-r--r--spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb2
-rw-r--r--spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb9
7 files changed, 39 insertions, 95 deletions
diff --git a/spec/features/projects/blobs/blame_spec.rb b/spec/features/projects/blobs/blame_spec.rb
index 9f061a2ff14..798cd401dac 100644
--- a/spec/features/projects/blobs/blame_spec.rb
+++ b/spec/features/projects/blobs/blame_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'File blame', :js, feature_category: :projects do
+RSpec.describe 'File blame', :js, feature_category: :groups_and_projects do
include TreeHelper
let_it_be(:project) { create(:project, :public, :repository) }
diff --git a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb
index 48ee39dad19..f0058e75e52 100644
--- a/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb
+++ b/spec/features/projects/blobs/blob_line_permalink_updater_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js, feature_category: :projects do
+RSpec.describe 'Blob button line permalinks (BlobLinePermalinkUpdater)', :js, feature_category: :groups_and_projects do
include TreeHelper
let(:project) { create(:project, :public, :repository) }
diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb
index cd1dde55e30..62cd9fd9a56 100644
--- a/spec/features/projects/blobs/blob_show_spec.rb
+++ b/spec/features/projects/blobs/blob_show_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'File blob', :js, feature_category: :projects do
+RSpec.describe 'File blob', :js, feature_category: :groups_and_projects do
include MobileHelpers
let(:project) { create(:project, :public, :repository) }
@@ -579,66 +579,6 @@ RSpec.describe 'File blob', :js, feature_category: :projects do
end
end
- describe '.gitlab/dashboards/custom-dashboard.yml' do
- let(:remove_monitor_metrics) { false }
-
- before do
- stub_feature_flags(remove_monitor_metrics: remove_monitor_metrics)
-
- project.add_maintainer(project.creator)
-
- Files::CreateService.new(
- project,
- project.creator,
- start_branch: 'master',
- branch_name: 'master',
- commit_message: "Add .gitlab/dashboards/custom-dashboard.yml",
- file_path: '.gitlab/dashboards/custom-dashboard.yml',
- file_content: file_content
- ).execute
-
- visit_blob('.gitlab/dashboards/custom-dashboard.yml')
- end
-
- context 'valid dashboard file' do
- let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) }
-
- it 'displays an auxiliary viewer' do
- aggregate_failures do
- # shows that dashboard yaml is valid
- expect(page).to have_content('Metrics Dashboard YAML definition is valid.')
-
- # shows a learn more link
- expect(page).to have_link('Learn more')
- end
- end
-
- context 'when metrics dashboard feature is unavailable' do
- let(:remove_monitor_metrics) { true }
-
- it 'displays the blob without an auxiliary viewer' do
- expect(page).to have_content('Environment metrics')
- expect(page).not_to have_content('Metrics Dashboard YAML definition', wait: 0)
- end
- end
- end
-
- context 'invalid dashboard file' do
- let(:file_content) { "dashboard: 'invalid'" }
-
- it 'displays an auxiliary viewer' do
- aggregate_failures do
- # shows that dashboard yaml is invalid
- expect(page).to have_content('Metrics Dashboard YAML definition is invalid:')
- expect(page).to have_content("panel_groups: should be an array of panel_groups objects")
-
- # shows a learn more link
- expect(page).to have_link('Learn more')
- end
- end
- end
- end
-
context 'LICENSE' do
before do
visit_blob('LICENSE')
diff --git a/spec/features/projects/blobs/edit_spec.rb b/spec/features/projects/blobs/edit_spec.rb
index 6e335871ed1..e8a9edcc0cc 100644
--- a/spec/features/projects/blobs/edit_spec.rb
+++ b/spec/features/projects/blobs/edit_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'Editing file blob', :js, feature_category: :projects do
+RSpec.describe 'Editing file blob', :js, feature_category: :groups_and_projects do
include Features::SourceEditorSpecHelpers
include TreeHelper
include Features::BlobSpecHelpers
@@ -23,15 +23,11 @@ RSpec.describe 'Editing file blob', :js, feature_category: :projects do
end
def edit_and_commit(commit_changes: true, is_diff: false)
- set_default_button('edit')
- refresh
- wait_for_requests
-
if is_diff
first('.js-diff-more-actions').click
click_link('Edit in single-file editor')
else
- click_link('Edit')
+ edit_in_single_file_editor
end
fill_editor(content: 'class NextFeature\\nend\\n')
@@ -83,29 +79,20 @@ RSpec.describe 'Editing file blob', :js, feature_category: :projects do
end
context 'blob edit toolbar' do
- toolbar_buttons = [
- "Add bold text",
- "Add italic text",
- "Add strikethrough text",
- "Insert a quote",
- "Insert code",
- "Add a link",
- "Add a bullet list",
- "Add a numbered list",
- "Add a checklist",
- "Add a collapsible section",
- "Add a table"
- ]
-
- it "does not have any buttons" do
- stub_feature_flags(source_editor_toolbar: true)
- visit project_edit_blob_path(project, tree_join(branch, readme_file_path))
- buttons = page.all('.file-buttons .md-header-toolbar button[type="button"]')
- expect(buttons.length).to eq(0)
- end
-
- it "has defined set of toolbar buttons when the flag is off" do
- stub_feature_flags(source_editor_toolbar: false)
+ def has_toolbar_buttons
+ toolbar_buttons = [
+ "Add bold text",
+ "Add italic text",
+ "Add strikethrough text",
+ "Insert a quote",
+ "Insert code",
+ "Add a link",
+ "Add a bullet list",
+ "Add a numbered list",
+ "Add a checklist",
+ "Add a collapsible section",
+ "Add a table"
+ ]
visit project_edit_blob_path(project, tree_join(branch, readme_file_path))
buttons = page.all('.file-buttons .md-header-toolbar button[type="button"]')
expect(buttons.length).to eq(toolbar_buttons.length)
@@ -113,6 +100,16 @@ RSpec.describe 'Editing file blob', :js, feature_category: :projects do
expect(buttons[i]['title']).to include(button_title)
end
end
+
+ it "has defined set of toolbar buttons when the flag is on" do
+ stub_feature_flags(source_editor_toolbar: true)
+ has_toolbar_buttons
+ end
+
+ it "has defined set of toolbar buttons when the flag is off" do
+ stub_feature_flags(source_editor_toolbar: false)
+ has_toolbar_buttons
+ end
end
context 'from blob file path' do
diff --git a/spec/features/projects/blobs/shortcuts_blob_spec.rb b/spec/features/projects/blobs/shortcuts_blob_spec.rb
index 03276a737da..162066540d9 100644
--- a/spec/features/projects/blobs/shortcuts_blob_spec.rb
+++ b/spec/features/projects/blobs/shortcuts_blob_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'Blob shortcuts', :js, feature_category: :projects do
+RSpec.describe 'Blob shortcuts', :js, feature_category: :groups_and_projects do
include TreeHelper
let(:project) { create(:project, :public, :repository) }
let(:path) { project.repository.ls_files(project.repository.root_ref)[0] }
diff --git a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb
index b723bd5690a..1990526b5fc 100644
--- a/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb
+++ b/spec/features/projects/blobs/user_follows_pipeline_suggest_nudge_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled', :js, feature_category: :projects do
+RSpec.describe 'User follows pipeline suggest nudge spec when feature is enabled', :js, feature_category: :groups_and_projects do
include CookieHelper
let(:project) { create(:project, :empty_repo) }
diff --git a/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb b/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb
index 3b383793de2..bef4e5f89b1 100644
--- a/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb
+++ b/spec/features/projects/blobs/user_views_pipeline_editor_button_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe 'User views pipeline editor button on root ci config file', :js, feature_category: :projects do
+RSpec.describe 'User views pipeline editor button on root ci config file', :js, feature_category: :groups_and_projects do
include Features::BlobSpecHelpers
let_it_be(:user) { create(:user) }
@@ -19,6 +19,8 @@ RSpec.describe 'User views pipeline editor button on root ci config file', :js,
project.repository.create_file(user, project.ci_config_path_or_default, 'test', message: 'testing', branch_name: 'master')
visit project_blob_path(project, File.join('master', '.my-config.yml'))
+ click_button 'Edit'
+
expect(page).to have_content('Edit in pipeline editor')
end
@@ -26,6 +28,8 @@ RSpec.describe 'User views pipeline editor button on root ci config file', :js,
project.repository.create_file(user, '.my-sub-config.yml', 'test', message: 'testing', branch_name: 'master')
visit project_blob_path(project, File.join('master', '.my-sub-config.yml'))
+ click_button 'Edit'
+
expect(page).not_to have_content('Edit in pipeline editor')
end
end
@@ -36,6 +40,9 @@ RSpec.describe 'User views pipeline editor button on root ci config file', :js,
end
it 'does not shows the Pipeline Editor button' do
visit project_blob_path(project, File.join('master', '.my-config.yml'))
+
+ click_button 'Edit'
+
expect(page).not_to have_content('Edit in pipeline editor')
end
end