summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-31 22:56:48 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-05-31 22:56:48 +0300
commit7090abfe415da5e3b44e7267cb6da2313fcb3f98 (patch)
tree5463c030769a1021d9fd5d4a2ac73c97eeb6d515 /spec
parent6debeb7ca91bbb0332f7f78877b4161e77a39b14 (diff)
downloadgitlab-ci-7090abfe415da5e3b44e7267cb6da2313fcb3f98.tar.gz
Fix specs
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/projects.rb2
-rw-r--r--spec/features/projects_spec.rb9
-rw-r--r--spec/models/build_spec.rb4
-rw-r--r--spec/models/project_spec.rb12
4 files changed, 6 insertions, 21 deletions
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index 87ecd5b..8bbb52e 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -4,7 +4,7 @@ FactoryGirl.define do
factory :project_without_token, class: Project do
name Faker::Name.name
default_ref 'master'
- path Rails.root.join('tmp', 'repositories', 'six').to_s
+ gitlab_url 'https://dev.gitlab.org/gitlab/six.git'
scripts 'ls'
factory :project do
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index 7f2b3eb..fceb596 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -50,13 +50,4 @@ describe "Projects" do
it { page.should have_content @project.name }
it { page.should have_content 'Integration with GitLab and other services' }
end
-
- describe "GET /projects/:id/run" do
- before do
- visit run_project_path(@project, ref: 'master')
- end
-
- it { current_path.should == project_build_path(@project, @project.builds.last) }
- it { page.should have_content @project.builds.last.git_commit_message }
- end
end
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb
index 71d2be5..c0969f7 100644
--- a/spec/models/build_spec.rb
+++ b/spec/models/build_spec.rb
@@ -19,10 +19,12 @@ describe Build do
describe "#ci_skip?" do
let(:project) { FactoryGirl.create(:project) }
let(:build) { project.register_build(ref: 'master') }
+
it 'true if commit message contains [ci skip]' do
- build.commit.stub(:message) { 'Small typo [ci skip]' }
+ build.stub(:git_commit_message) { 'Small typo [ci skip]' }
build.ci_skip?.should == true
end
+
it 'false if commit message does not contain [ci skip]' do
build.ci_skip?.should == false
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 77cc1c9..354a7a7 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -5,11 +5,6 @@ describe Project do
it { should have_many(:builds) }
- describe :path do
- it { should allow_value(Rails.root.join('tmp', 'repositories', 'six').to_s).for(:path) }
- it { should_not allow_value('/tmp').for(:path) }
- end
-
describe 'before_validation' do
it 'should set an random token if none provided' do
project = FactoryGirl.create :project_without_token
@@ -30,10 +25,8 @@ describe Project do
context :valid_project do
let(:project) { FactoryGirl.create :project }
- it { project.repo_present?.should be_true }
-
describe :register_build do
- let(:build) { project.register_build(ref: 'master') }
+ let(:build) { project.register_build(ref: 'master', after: '31das312') }
it { build.should be_kind_of(Build) }
it { build.should be_pending }
@@ -42,13 +35,12 @@ describe Project do
end
context :project_with_build do
- before { project.register_build ref: 'master' }
+ before { project.register_build ref: 'master', after: '31das312' }
it { project.status.should == 'pending' }
it { project.last_build.should be_kind_of(Build) }
it { project.human_status.should == 'pending' }
it { project.status_image.should == 'running.png' }
- it { project.last_commit.oid.should == '1c8a9df454ef68c22c2a33cca8232bb50849e5c5' }
end
end
end