Skip to content
Snippets Groups Projects
Select Git revision
  • ag-test
  • rs-test
  • master default protected
  • test-me-pa
  • mksionek-master-patch-52381
  • new-branch-10
  • test-conflicts
  • test-suggestions
  • alejandro-test
  • patch-25
  • winh-test-image-doscussion
  • stg-lfs-image-test-2
  • stg-lfs-image-test
  • test42016
  • issue_42016
  • issue-32709
  • add-codeowners
  • ClemMakesApps-master-patch-62759
  • bvl-staging-test
  • bvl-merge-base-api
  • v9.2.0-rc6 protected
  • v9.2.0-rc5 protected
  • v9.2.0-rc4 protected
  • v9.2.0-rc3 protected
  • v9.1.4 protected
  • v9.2.0-rc2 protected
  • v9.2.0-rc1 protected
  • v9.1.3 protected
  • v8.17.6 protected
  • v9.0.7 protected
  • v9.1.2 protected
  • v9.1.1 protected
  • v9.2.0.pre protected
  • v9.1.0 protected
  • v9.1.0-rc7 protected
  • v9.1.0-rc6 protected
  • v9.0.6 protected
  • v9.1.0-rc5 protected
  • v9.1.0-rc4 protected
  • v9.1.0-rc3 protected
40 results

gitlab_ci_service_spec.rb

Blame
    • Kamil Trzcinski's avatar
      ba68facf
      CI details cleanup · ba68facf
      Kamil Trzcinski authored
      - Add page titles to CI settings.
      - Fix CI admin navigation.
      - Remove duplicated scope.
      - Use monospace font for commit sha.
      - Add page title and header title to build page.
      - Proper authorization for cancel/retry builds.
      - Use gitlab pagination theme for builds and group members.
      - Don't paginate builds widget on build page.
      - Add badges to commit page Changes/Builds tabs.
      - Add "Builds" to commit Builds tab page title.
      - Add and use Ci::Build#retryable? method.
      - Add CI::Build#retried? method.
      - Allow all failed commit builds to be retried.
      - Proper authorization for cancel/retry all builds.
      - Remove unused param.
      - Use time_ago_with_tooltip where appropriate.
      - Tweak builds index text
      - Remove duplication between builds/build and commit_statuses/commit_status.
      - Use POST rather than GET for canceling and retrying builds.
      - Remove redundant URL helpers.
      - Add build ID to build page.
      - Link branch name on build page.
      - Move commit/:sha/ci to commit/:sha/builds.
      ba68facf
      History
      CI details cleanup
      Kamil Trzcinski authored
      - Add page titles to CI settings.
      - Fix CI admin navigation.
      - Remove duplicated scope.
      - Use monospace font for commit sha.
      - Add page title and header title to build page.
      - Proper authorization for cancel/retry builds.
      - Use gitlab pagination theme for builds and group members.
      - Don't paginate builds widget on build page.
      - Add badges to commit page Changes/Builds tabs.
      - Add "Builds" to commit Builds tab page title.
      - Add and use Ci::Build#retryable? method.
      - Add CI::Build#retried? method.
      - Allow all failed commit builds to be retried.
      - Proper authorization for cancel/retry all builds.
      - Remove unused param.
      - Use time_ago_with_tooltip where appropriate.
      - Tweak builds index text
      - Remove duplication between builds/build and commit_statuses/commit_status.
      - Use POST rather than GET for canceling and retrying builds.
      - Remove redundant URL helpers.
      - Add build ID to build page.
      - Link branch name on build page.
      - Move commit/:sha/ci to commit/:sha/builds.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    gitlab_ci_service_spec.rb 1.88 KiB
    # == Schema Information
    #
    # Table name: services
    #
    #  id                    :integer          not null, primary key
    #  type                  :string(255)
    #  title                 :string(255)
    #  project_id            :integer
    #  created_at            :datetime
    #  updated_at            :datetime
    #  active                :boolean          default(FALSE), not null
    #  properties            :text
    #  template              :boolean          default(FALSE)
    #  push_events           :boolean          default(TRUE)
    #  issues_events         :boolean          default(TRUE)
    #  merge_requests_events :boolean          default(TRUE)
    #  tag_push_events       :boolean          default(TRUE)
    #  note_events           :boolean          default(TRUE), not null
    #
    
    require 'spec_helper'
    
    describe GitlabCiService do
      describe 'associations' do
        it { is_expected.to belong_to(:project) }
        it { is_expected.to have_one(:service_hook) }
      end
    
      describe 'commits methods' do
        before do
          @ci_project = create(:ci_project)
          @service = GitlabCiService.new
          allow(@service).to receive_messages(
            service_hook: true,
            project_url: 'http://ci.gitlab.org/projects/2',
            token: 'verySecret',
            project: @ci_project.gl_project
          )
        end
    
        describe :build_page do
          it { expect(@service.build_page("2ab7834c", 'master')).to eq("http://localhost/#{@ci_project.gl_project.path_with_namespace}/commit/2ab7834c/builds")}
        end
    
        describe "execute" do
          let(:user)    { create(:user, username: 'username') }
          let(:project) { create(:project, name: 'project') }
          let(:push_sample_data) { Gitlab::PushDataBuilder.build_sample(project, user) }
    
          it "calls CreateCommitService" do
            expect_any_instance_of(Ci::CreateCommitService).to receive(:execute).with(@ci_project, user, push_sample_data)
    
            @service.execute(push_sample_data)
          end
        end
      end
    end