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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-28 16:18:25 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-29 11:47:03 +0300
commit8f8efcfa00c40beacae9886d7be51e82e7a67989 (patch)
tree2afcfcf856bdc8a538383ee910e3c086b9b71902 /spec/models/ci
parent2c1f7ccac8180a49e45fb3cf79e03318420d1037 (diff)
Fix tests
Diffstat (limited to 'spec/models/ci')
-rw-r--r--spec/models/ci/project_spec.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/models/ci/project_spec.rb b/spec/models/ci/project_spec.rb
index b83eccb94e2..fe12160659c 100644
--- a/spec/models/ci/project_spec.rb
+++ b/spec/models/ci/project_spec.rb
@@ -28,9 +28,8 @@
require 'spec_helper'
describe Ci::Project do
- let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project }
- let (:gl_project) { }
- subject { FactoryGirl.build :ci_project }
+ let(:gl_project) { FactoryGirl.create :empty_project }
+ subject { FactoryGirl.create :ci_project, gl_project: gl_project }
it { is_expected.to have_many(:runner_projects) }
it { is_expected.to have_many(:runners) }
@@ -40,9 +39,7 @@ describe Ci::Project do
it { is_expected.to have_many(:triggers) }
it { is_expected.to have_many(:services) }
- it { is_expected.to validate_presence_of :name }
it { is_expected.to validate_presence_of :timeout }
- it { is_expected.to validate_presence_of :default_ref }
describe 'before_validation' do
it 'should set an random token if none provided' do
@@ -78,7 +75,7 @@ describe Ci::Project do
it 'returns ordered list of commits' do
commit1 = FactoryGirl.create :ci_commit, committed_at: 1.hour.ago, gl_project: project
commit2 = FactoryGirl.create :ci_commit, committed_at: 2.hour.ago, gl_project: project
- expect(project.commits).to eq([commit2.project, commit1.project])
+ expect(project.commits).to eq([commit2, commit1])
end
it 'returns commits ordered by committed_at and id, with nulls last' do
@@ -86,7 +83,7 @@ describe Ci::Project do
commit2 = FactoryGirl.create :ci_commit, committed_at: nil, gl_project: project
commit3 = FactoryGirl.create :ci_commit, committed_at: 2.hour.ago, gl_project: project
commit4 = FactoryGirl.create :ci_commit, committed_at: nil, gl_project: project
- expect(project.commits).to eq([commit2.project, commit4.project, commit3.project, commit1.project])
+ expect(project.commits).to eq([commit2, commit4, commit3, commit1])
end
end