2013-01-03 07:37:13 +00:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: services
|
|
|
|
#
|
2014-10-09 15:22:20 +00:00
|
|
|
# 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
|
2013-01-03 07:37:13 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe GitlabCiService do
|
|
|
|
describe "Associations" do
|
2015-02-12 18:17:35 +00:00
|
|
|
it { is_expected.to belong_to :project }
|
|
|
|
it { is_expected.to have_one :service_hook }
|
2013-01-03 07:37:13 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "Mass assignment" do
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'commits methods' do
|
|
|
|
before do
|
|
|
|
@service = GitlabCiService.new
|
|
|
|
@service.stub(
|
|
|
|
service_hook: true,
|
|
|
|
project_url: 'http://ci.gitlab.org/projects/2',
|
|
|
|
token: 'verySecret'
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe :commit_status_path do
|
2015-02-12 18:17:35 +00:00
|
|
|
it { expect(@service.commit_status_path("2ab7834c")).to eq("http://ci.gitlab.org/projects/2/commits/2ab7834c/status.json?token=verySecret")}
|
2013-01-03 07:37:13 +00:00
|
|
|
end
|
2013-01-03 07:52:14 +00:00
|
|
|
|
|
|
|
describe :build_page do
|
2015-02-12 18:17:35 +00:00
|
|
|
it { expect(@service.build_page("2ab7834c")).to eq("http://ci.gitlab.org/projects/2/commits/2ab7834c")}
|
2013-01-03 07:52:14 +00:00
|
|
|
end
|
2013-01-03 07:37:13 +00:00
|
|
|
end
|
|
|
|
end
|