summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-28 16:49:31 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-29 10:47:04 +0200
commit0f3deac362cf2800ceaf17f4cded765f6c9d577c (patch)
treea4ea1bee9c7dfe9760f0bc78ab7fae7fe9b8496f
parent0fa4ab5fd8e0cb775ff4fe75d011ff717f0b3945 (diff)
downloadgitlab-ce-0f3deac362cf2800ceaf17f4cded765f6c9d577c.tar.gz
Fix tests
-rw-r--r--features/steps/project/commits/commits.rb2
-rw-r--r--features/steps/shared/project.rb2
-rw-r--r--spec/lib/ci/charts_spec.rb5
-rw-r--r--spec/models/project_spec.rb8
4 files changed, 9 insertions, 8 deletions
diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb
index 56f1f06fb06..47f58091b93 100644
--- a/features/steps/project/commits/commits.rb
+++ b/features/steps/project/commits/commits.rb
@@ -104,7 +104,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps
step 'commit has ci status' do
@project.enable_ci(@user)
- create :ci_commit, project: @project.gitlab_ci_project, sha: sample_commit.id
+ create :ci_commit, gl_project: @project, sha: sample_commit.id
end
step 'I see commit ci info' do
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index fa841f67510..fc51cec150e 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -204,6 +204,6 @@ module SharedProject
step 'project "Shop" has CI build' do
project = Project.find_by(name: "Shop")
- create :ci_commit, project: project.gitlab_ci_project, sha: project.commit.sha
+ create :ci_commit, gl_project: project, sha: project.commit.sha
end
end
diff --git a/spec/lib/ci/charts_spec.rb b/spec/lib/ci/charts_spec.rb
index 24894e81983..83e2ad220b8 100644
--- a/spec/lib/ci/charts_spec.rb
+++ b/spec/lib/ci/charts_spec.rb
@@ -4,13 +4,12 @@ describe "Charts" do
context "build_times" do
before do
- @project = FactoryGirl.create(:ci_project)
- @commit = FactoryGirl.create(:ci_commit, project: @project)
+ @commit = FactoryGirl.create(:ci_commit)
FactoryGirl.create(:ci_build, commit: @commit)
end
it 'should return build times in minutes' do
- chart = Ci::Charts::BuildTime.new(@project)
+ chart = Ci::Charts::BuildTime.new(@commit.project)
expect(chart.build_times).to eq([2])
end
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 9e7b6f5cb30..cbb49044cd1 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -404,10 +404,12 @@ describe Project do
describe :ci_commit do
let(:project) { create :project }
- let(:ci_project) { create :ci_project, gl_project: project }
- let(:commit) { create :ci_commit, project: ci_project }
+ let(:commit) { create :ci_commit, gl_project: project }
- before { project.create_gitlab_ci_service(active: true) }
+ before do
+ project.ensure_ci_project
+ project.create_gitlab_ci_service(active: true)
+ end
it { expect(project.ci_commit(commit.sha)).to eq(commit) }
end