diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-14 15:06:59 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-12-14 15:06:59 +0300 |
commit | c0ff4fdd99d44e154083242e32207f567374c8b1 (patch) | |
tree | c48b51cf209edb021134d2b2000c9027c48d624b /spec/features/admin/admin_builds_spec.rb | |
parent | 1859b1061740fb667449c9e8e457d1c3dd1b3344 (diff) |
Move CI admin builds and runners specs to correct directory [ci skip]
Diffstat (limited to 'spec/features/admin/admin_builds_spec.rb')
-rw-r--r-- | spec/features/admin/admin_builds_spec.rb | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/spec/features/admin/admin_builds_spec.rb b/spec/features/admin/admin_builds_spec.rb new file mode 100644 index 00000000000..72764b1629d --- /dev/null +++ b/spec/features/admin/admin_builds_spec.rb @@ -0,0 +1,69 @@ +require 'spec_helper' + +describe "Admin Builds" do + let(:commit) { FactoryGirl.create :ci_commit } + let(:build) { FactoryGirl.create :ci_build, commit: commit } + + before do + login_as :admin + end + + describe "GET /admin/builds" do + before do + build + visit admin_builds_path + end + + it { expect(page).to have_content "Running" } + it { expect(page).to have_content build.short_sha } + end + + describe "Tabs" do + it "shows all builds" do + FactoryGirl.create :ci_build, commit: commit, status: "pending" + FactoryGirl.create :ci_build, commit: commit, status: "running" + FactoryGirl.create :ci_build, commit: commit, status: "success" + FactoryGirl.create :ci_build, commit: commit, status: "failed" + + visit admin_builds_path + + within ".center-top-menu" do + click_on "All" + end + + expect(page.all(".build-link").size).to eq(4) + end + + it "shows finished builds" do + build = FactoryGirl.create :ci_build, commit: commit, status: "pending" + build1 = FactoryGirl.create :ci_build, commit: commit, status: "running" + build2 = FactoryGirl.create :ci_build, commit: commit, status: "success" + + visit admin_builds_path + + within ".center-top-menu" do + click_on "Finished" + end + + expect(page.find(".build-link")).not_to have_content(build.id) + expect(page.find(".build-link")).not_to have_content(build1.id) + expect(page.find(".build-link")).to have_content(build2.id) + end + + it "shows running builds" do + build = FactoryGirl.create :ci_build, commit: commit, status: "pending" + build2 = FactoryGirl.create :ci_build, commit: commit, status: "success" + build3 = FactoryGirl.create :ci_build, commit: commit, status: "failed" + + visit admin_builds_path + + within ".center-top-menu" do + click_on "Running" + end + + expect(page.find(".build-link")).to have_content(build.id) + expect(page.find(".build-link")).not_to have_content(build2.id) + expect(page.find(".build-link")).not_to have_content(build3.id) + end + end +end |