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>2022-08-30 21:09:50 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-30 21:09:50 +0300
commit6619ed911ffab93b90756bf392d2925fdc0c1ee2 (patch)
tree79d122438dd8e1cb672f8bb52b9d573bd49bdd77 /spec/views/projects
parent4b1fc3dc32e768499d81ed64ea7ed497c1785c48 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/projects')
-rw-r--r--spec/views/projects/commits/_commit.html.haml_spec.rb37
1 files changed, 25 insertions, 12 deletions
diff --git a/spec/views/projects/commits/_commit.html.haml_spec.rb b/spec/views/projects/commits/_commit.html.haml_spec.rb
index 2ca23d4cb2d..4e8a680b6de 100644
--- a/spec/views/projects/commits/_commit.html.haml_spec.rb
+++ b/spec/views/projects/commits/_commit.html.haml_spec.rb
@@ -47,13 +47,12 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
context 'with ci status' do
let(:ref) { 'master' }
- let(:user) { create(:user) }
+
+ let_it_be(:user) { create(:user) }
before do
allow(view).to receive(:current_user).and_return(user)
- project.add_developer(user)
-
create(
:ci_empty_pipeline,
ref: 'master',
@@ -80,18 +79,32 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
end
context 'when pipelines are enabled' do
- before do
- allow(project).to receive(:builds_enabled?).and_return(true)
+ context 'when user has access' do
+ before do
+ project.add_developer(user)
+ end
+
+ it 'displays a ci status icon' do
+ render partial: template, formats: :html, locals: {
+ project: project,
+ ref: ref,
+ commit: commit
+ }
+
+ expect(rendered).to have_css('.ci-status-link')
+ end
end
- it 'does display a ci status icon when pipelines are enabled' do
- render partial: template, formats: :html, locals: {
- project: project,
- ref: ref,
- commit: commit
- }
+ context 'when user does not have access' do
+ it 'does not display a ci status icon' do
+ render partial: template, formats: :html, locals: {
+ project: project,
+ ref: ref,
+ commit: commit
+ }
- expect(rendered).to have_css('.ci-status-link')
+ expect(rendered).not_to have_css('.ci-status-link')
+ end
end
end
end