Skip to content
Snippets Groups Projects
Commit d9ece71e authored by Kamil Trzcinski's avatar Kamil Trzcinski
Browse files

Fix specs

parent 4d69c6a3
No related branches found
No related tags found
1 merge request!1593Added builds view
Pipeline #
Loading
@@ -78,7 +78,7 @@ module Ci
Loading
@@ -78,7 +78,7 @@ module Ci
end end
   
def short_sha def short_sha
token[0...8] token[0...8] if token
end end
end end
end end
Loading
@@ -113,7 +113,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
Loading
@@ -113,7 +113,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
end end
   
step 'I click status link' do step 'I click status link' do
click_link "Builds" find('.commit-ci-menu').click_link "Builds"
end end
   
step 'I see builds list' do step 'I see builds list' do
Loading
Loading
Loading
@@ -10,40 +10,40 @@ describe "Builds" do
Loading
@@ -10,40 +10,40 @@ describe "Builds" do
end end
   
describe "GET /:project/builds" do describe "GET /:project/builds" do
context "All builds" do context "Running scope" do
before do before do
@build.success @build.run!
visit namespace_project_builds_path(@gl_project.namespace, @gl_project) visit namespace_project_builds_path(@gl_project.namespace, @gl_project)
end end
   
it { expect(page).to have_content 'All builds' } it { expect(page).to have_content 'Running' }
it { expect(page).to have_content 'Cancel all' }
it { expect(page).to have_content @build.short_sha } it { expect(page).to have_content @build.short_sha }
it { expect(page).to have_content @build.ref } it { expect(page).to have_content @build.ref }
it { expect(page).to have_content @build.name } it { expect(page).to have_content @build.name }
it { expect(page).to_not have_content 'Cancel all' }
end end
   
context "Pending scope" do context "Finished scope" do
before do before do
@build.success @build.run!
visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :pending) visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :finished)
end end
   
it { expect(page).to have_content 'No builds to show' } it { expect(page).to have_content 'No builds to show' }
it { expect(page).to_not have_content 'Cancel all' } it { expect(page).to have_content 'Cancel all' }
end end
   
context "Running scope" do context "All builds" do
before do before do
@build.run! @gl_project.ci_builds.running_or_pending.each(&:success)
visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :running) visit namespace_project_builds_path(@gl_project.namespace, @gl_project, scope: :all)
end end
   
it { expect(page).to have_content 'Running' } it { expect(page).to have_content 'All' }
it { expect(page).to have_content 'Cancel all' }
it { expect(page).to have_content @build.short_sha } it { expect(page).to have_content @build.short_sha }
it { expect(page).to have_content @build.ref } it { expect(page).to have_content @build.ref }
it { expect(page).to have_content @build.name } it { expect(page).to have_content @build.name }
it { expect(page).to_not have_content 'Cancel all' }
end end
end end
   
Loading
@@ -53,7 +53,7 @@ describe "Builds" do
Loading
@@ -53,7 +53,7 @@ describe "Builds" do
visit cancel_namespace_project_build_path(@gl_project.namespace, @gl_project, @build) visit cancel_namespace_project_build_path(@gl_project.namespace, @gl_project, @build)
end end
   
it { expect(page).to have_content 'All builds' } it { expect(page).to have_content 'All' }
it { expect(page).to have_content 'canceled' } it { expect(page).to have_content 'canceled' }
it { expect(page).to_not have_content 'Cancel all' } it { expect(page).to_not have_content 'Cancel all' }
end end
Loading
Loading
Loading
@@ -32,7 +32,7 @@ describe Ci::Runner do
Loading
@@ -32,7 +32,7 @@ describe Ci::Runner do
end end
   
it 'should return the token if the description is an empty string' do it 'should return the token if the description is an empty string' do
runner = FactoryGirl.build(:ci_runner, description: '') runner = FactoryGirl.build(:ci_runner, description: '', token: 'token')
expect(runner.display_name).to eq runner.token expect(runner.display_name).to eq runner.token
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment