diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-19 21:14:05 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-20 11:33:49 +0200 |
| commit | c3b074acab554fc40a8fcb6060ed7ab10e4171a4 (patch) | |
| tree | b524e4c96f998534522f2b4b4fea9994da8c6983 /spec/models | |
| parent | be1dc5544a7840d17657d3d8fcecb0d0fd4401b5 (diff) | |
| download | gitlab-ce-c3b074acab554fc40a8fcb6060ed7ab10e4171a4.tar.gz | |
Service model and service hook
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/service_hook_spec.rb | 19 | ||||
| -rw-r--r-- | spec/models/service_spec.rb | 25 |
2 files changed, 44 insertions, 0 deletions
diff --git a/spec/models/service_hook_spec.rb b/spec/models/service_hook_spec.rb new file mode 100644 index 00000000000..25fc409646d --- /dev/null +++ b/spec/models/service_hook_spec.rb @@ -0,0 +1,19 @@ +# == Schema Information +# +# Table name: web_hooks +# +# id :integer not null, primary key +# url :string(255) +# project_id :integer +# created_at :datetime not null +# updated_at :datetime not null +# type :string(255) default("ProjectHook") +# + +require "spec_helper" + +describe ServiceHook do + describe "Associations" do + it { should belong_to :service } + end +end diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb new file mode 100644 index 00000000000..0329b9a94e3 --- /dev/null +++ b/spec/models/service_spec.rb @@ -0,0 +1,25 @@ +# == Schema Information +# +# Table name: services +# +# id :integer not null, primary key +# type :string(255) +# title :string(255) +# token :string(255) +# project_id :integer not null +# created_at :datetime not null +# updated_at :datetime not null +# + +require 'spec_helper' + +describe Service do + describe "Associations" do + it { should belong_to :project } + it { should have_one :service_hook } + end + + describe "Mass assignment" do + it { should_not allow_mass_assignment_of(:project_id) } + end +end |
