diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-03 09:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-03 09:08:47 +0000 |
commit | 31a432e38a8b70d3ffb16afa8d7cfeee4f5f5921 (patch) | |
tree | b59f8b4e2ef7486f13adb01328a749f19b93a023 /spec/features/projects/blobs/blob_show_spec.rb | |
parent | 6b7b853dff4cb7e72d76bd501d75708111c95585 (diff) | |
download | gitlab-ce-31a432e38a8b70d3ffb16afa8d7cfeee4f5f5921.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/blobs/blob_show_spec.rb')
-rw-r--r-- | spec/features/projects/blobs/blob_show_spec.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb index 9fc70412975..550dacf7597 100644 --- a/spec/features/projects/blobs/blob_show_spec.rb +++ b/spec/features/projects/blobs/blob_show_spec.rb @@ -555,6 +555,53 @@ describe 'File blob', :js do end end + describe '.gitlab/dashboards/custom-dashboard.yml' do + before do + 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 + 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: can't be blank") + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + end + context 'LICENSE' do before do visit_blob('LICENSE') |