diff options
author | Kestred <kestred@riotcave.com> | 2014-08-23 22:27:52 -0700 |
---|---|---|
committer | Kestred <kestred@riotcave.com> | 2014-08-23 22:27:52 -0700 |
commit | 18f954b31c242822b6c7430a50ca99a93adc6ea6 (patch) | |
tree | b7ee4acac738d5b64b6fcfaf909756f784dd2d61 /spec/models/project_spec.rb | |
parent | 2eb3d91e1a6e51d3ca0be2fe0a5df750708b366d (diff) | |
download | gitlab-ci-18f954b31c242822b6c7430a50ca99a93adc6ea6.tar.gz |
Separate Commit model and logic from Build model|etc...
This is an entirely non-user facing change which prepares GitLab CI for future support of Parallel Builds.
See https://about.gitlab.com/2013/12/19/gitlab-ci-with-parallel-builds-and-deployments/.
These changes specifically avoid changing the supported API or changing any of the website views.
Changes to the website views will come in tandem with future features like "Multiple build scripts".
The supported API won't change as part of any future changes on this vein, to maintain support for the unofficial GitLab CI runners.
This closes the following implementation step:
1. A commit has many builds
Signed-off-by: Kestred <kestred@riotcave.com>
Diffstat (limited to 'spec/models/project_spec.rb')
-rw-r--r-- | spec/models/project_spec.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index fc06414..0e29b5c 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -27,7 +27,7 @@ require 'spec_helper' describe Project do subject { FactoryGirl.build :project } - it { should have_many(:builds) } + it { should have_many(:commits) } it { should validate_presence_of :name } it { should validate_presence_of :scripts } @@ -49,8 +49,11 @@ describe Project do context :valid_project do let(:project) { FactoryGirl.create :project } - context :project_with_build do - before { FactoryGirl.create(:build, project: project) } + context :project_with_commit_and_builds do + before do + commit = FactoryGirl.create(:commit, project: project) + FactoryGirl.create(:build, commit: commit) + end it { project.status.should == 'pending' } it { project.last_build.should be_kind_of(Build) } |