diff options
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 |