Welcome to mirror list, hosted at ThFree Co, Russian Federation.

builds_spec.rb « admin « features « ci « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e62e83692dab4bf8fd730e392214638f60340393 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require 'spec_helper'

describe "Admin Builds" do
  let(:project) { FactoryGirl.create :project }
  let(:commit) { FactoryGirl.create :commit, project: project }
  let(:build) { FactoryGirl.create :build, commit: commit }

  before do
    skip_admin_auth
    login_as :user
  end

  describe "GET /admin/builds" do
    before do
      build
      visit admin_builds_path
    end

    it { page.should have_content "All builds" }
    it { page.should have_content build.short_sha }
  end

  describe "Tabs" do
    it "shows all builds" do
      build = FactoryGirl.create :build, commit: commit, status: "pending"
      build1 = FactoryGirl.create :build, commit: commit, status: "running"
      build2 = FactoryGirl.create :build, commit: commit, status: "success"
      build3 = FactoryGirl.create :build, commit: commit, status: "failed"

      visit admin_builds_path

      page.all(".build-link").size.should == 4
    end

    it "shows pending builds" do
      build = FactoryGirl.create :build, commit: commit, status: "pending"
      build1 = FactoryGirl.create :build, commit: commit, status: "running"
      build2 = FactoryGirl.create :build, commit: commit, status: "success"
      build3 = FactoryGirl.create :build, commit: commit, status: "failed"

      visit admin_builds_path

      within ".nav.nav-tabs" do
        click_on "Pending"
      end

      page.find(".build-link").should have_content(build.id)
      page.find(".build-link").should_not have_content(build1.id)
      page.find(".build-link").should_not have_content(build2.id)
      page.find(".build-link").should_not have_content(build3.id)
    end

    it "shows running builds" do
      build = FactoryGirl.create :build, commit: commit, status: "pending"
      build1 = FactoryGirl.create :build, commit: commit, status: "running"
      build2 = FactoryGirl.create :build, commit: commit, status: "success"
      build3 = FactoryGirl.create :build, commit: commit, status: "failed"

      visit admin_builds_path

      within ".nav.nav-tabs" do
        click_on "Running"
      end

      page.find(".build-link").should have_content(build1.id)
      page.find(".build-link").should_not have_content(build.id)
      page.find(".build-link").should_not have_content(build2.id)
      page.find(".build-link").should_not have_content(build3.id)
    end
  end
end