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:
Diffstat (limited to 'spec/ci/models/service_spec.rb')
-rw-r--r--spec/ci/models/service_spec.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/ci/models/service_spec.rb b/spec/ci/models/service_spec.rb
new file mode 100644
index 00000000000..22a49e10a6c
--- /dev/null
+++ b/spec/ci/models/service_spec.rb
@@ -0,0 +1,49 @@
+# == Schema Information
+#
+# Table name: services
+#
+# id :integer not null, primary key
+# type :string(255)
+# title :string(255)
+# project_id :integer not null
+# created_at :datetime
+# updated_at :datetime
+# active :boolean default(FALSE), not null
+# properties :text
+#
+
+require 'spec_helper'
+
+describe Service do
+
+ describe "Associations" do
+ it { should belong_to :project }
+ end
+
+ describe "Mass assignment" do
+ end
+
+ describe "Test Button" do
+ before do
+ @service = Service.new
+ end
+
+ describe "Testable" do
+ let (:project) { FactoryGirl.create :project }
+ let (:commit) { FactoryGirl.create :commit, project: project }
+ let (:build) { FactoryGirl.create :build, commit: commit }
+
+ before do
+ @service.stub(
+ project: project
+ )
+ build
+ @testable = @service.can_test?
+ end
+
+ describe :can_test do
+ it { @testable.should == true }
+ end
+ end
+ end
+end