diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2017-09-04 09:27:09 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2017-09-04 09:27:09 +0200 |
commit | 78dad4cf321eb84aa5decdea34704145adca0c3e (patch) | |
tree | 4152d4d57accc4bdc87ca05f4a61124bf9bcc82f | |
parent | df3d4764034bdad9f6151ab8808b71e1e5088d9c (diff) | |
download | gitlab-ce-78dad4cf321eb84aa5decdea34704145adca0c3e.tar.gz |
Fix tests
-rw-r--r-- | app/models/project.rb | 6 | ||||
-rw-r--r-- | app/views/admin/application_settings/_form.html.haml | 4 | ||||
-rw-r--r-- | config/initializers/0_inflections.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/import_export.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/relation_factory.rb | 1 | ||||
-rw-r--r-- | spec/features/projects/settings/pipelines_settings_spec.rb | 10 | ||||
-rw-r--r-- | spec/lib/gitlab/import_export/safe_model_attributes.yml | 5 |
7 files changed, 25 insertions, 5 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index cc9fd215070..b0dee5ffb89 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -468,7 +468,11 @@ class Project < ActiveRecord::Base end def auto_devops_enabled? - auto_devops&.enabled? || current_application_settings.auto_devops_enabled? + if auto_devops + auto_devops.enabled? + else + current_application_settings.auto_devops_enabled? + end end def repository_storage_path diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml index a00fc978494..5066dcb109b 100644 --- a/app/views/admin/application_settings/_form.html.haml +++ b/app/views/admin/application_settings/_form.html.haml @@ -226,8 +226,8 @@ Enabled Auto DevOps (Beta) for projects by default .help-block It will automatically build, test, and deploy applications based on a predefined CI/CD configuration - - # Fix this link - = link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'maximum-artifacts-size') + = link_to icon('question-circle'), help_page_path('topics/autodevops/index.md') + .form-group .col-sm-offset-2.col-sm-10 .checkbox diff --git a/config/initializers/0_inflections.rb b/config/initializers/0_inflections.rb index 1ad9ddca877..da19c765f50 100644 --- a/config/initializers/0_inflections.rb +++ b/config/initializers/0_inflections.rb @@ -14,6 +14,6 @@ ActiveSupport::Inflector.inflections do |inflect| award_emoji project_statistics system_note_metadata - project_auto_devops + auto_devops ) end diff --git a/lib/gitlab/import_export/import_export.yml b/lib/gitlab/import_export/import_export.yml index d164a9adb2d..0ea1699108b 100644 --- a/lib/gitlab/import_export/import_export.yml +++ b/lib/gitlab/import_export/import_export.yml @@ -50,7 +50,7 @@ project_tree: - :push_event_payload - :stages - :statuses - - :project_auto_devops + - :auto_devops - :triggers - :pipeline_schedules - :services diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb index 20580459046..e6e7e3573b0 100644 --- a/lib/gitlab/import_export/relation_factory.rb +++ b/lib/gitlab/import_export/relation_factory.rb @@ -14,6 +14,7 @@ module Gitlab create_access_levels: 'ProtectedTag::CreateAccessLevel', labels: :project_labels, priorities: :label_priorities, + auto_devops: 'ProjectAutoDevops', label: :project_label }.freeze USER_REFERENCES = %w[author_id assignee_id updated_by_id user_id created_by_id last_edited_by_id merge_user_id resolved_by_id].freeze diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index 232d796a200..975d204e75e 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -41,5 +41,15 @@ feature "Pipelines settings" do checkbox = find_field('project_auto_cancel_pending_pipelines') expect(checkbox).to be_checked end + + scenario 'update auto devops settings' do + fill_in('project_auto_devops_attributes_domain', with: 'test.com') + page.choose('project_auto_devops_attributes_enabled_false') + click_on 'Save changes' + + expect(page.status_code).to eq(200) + expect(project.auto_devops).to be_present + expect(project.auto_devops).not_to be_enabled + end end end diff --git a/spec/lib/gitlab/import_export/safe_model_attributes.yml b/spec/lib/gitlab/import_export/safe_model_attributes.yml index a5e03e149a7..6e77c955b05 100644 --- a/spec/lib/gitlab/import_export/safe_model_attributes.yml +++ b/spec/lib/gitlab/import_export/safe_model_attributes.yml @@ -224,6 +224,7 @@ Ci::Pipeline: - lock_version - auto_canceled_by_id - pipeline_schedule_id +- config_source Ci::Stage: - id - name @@ -462,3 +463,7 @@ Timelog: - user_id - created_at - updated_at +ProjectAutoDevops: +- id +- enabled +- domain |