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/helpers/projects/ml/experiments_helper_spec.rb')
-rw-r--r--spec/helpers/projects/ml/experiments_helper_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/helpers/projects/ml/experiments_helper_spec.rb b/spec/helpers/projects/ml/experiments_helper_spec.rb
index 021d518a329..569fd0f9ec5 100644
--- a/spec/helpers/projects/ml/experiments_helper_spec.rb
+++ b/spec/helpers/projects/ml/experiments_helper_spec.rb
@@ -36,7 +36,7 @@ RSpec.describe Projects::Ml::ExperimentsHelper, feature_category: :mlops do
let_it_be(:candidates) { [candidate0, candidate1] }
describe '#candidates_table_items' do
- subject { Gitlab::Json.parse(helper.candidates_table_items(candidates)) }
+ subject { Gitlab::Json.parse(helper.candidates_table_items(candidates, project.creator)) }
it 'creates the correct model for the table', :aggregate_failures do
expected_values = [
@@ -72,6 +72,18 @@ RSpec.describe Projects::Ml::ExperimentsHelper, feature_category: :mlops do
expect(subject[0]['user']).to be_nil
end
end
+
+ context 'when user is not allowed to read the project' do
+ before do
+ allow(Ability).to receive(:allowed?)
+ .with(project.creator, :read_build, build)
+ .and_return(false)
+ end
+
+ it 'does not include ci info' do
+ expect(subject[0]['ci_job']).to be_nil
+ end
+ end
end
describe '#unique_logged_names' do