2012-10-09 10:14:17 +02:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: protected_branches
|
|
|
|
#
|
2012-11-19 19:24:05 +01:00
|
|
|
# id :integer not null, primary key
|
|
|
|
# project_id :integer not null
|
|
|
|
# name :string(255) not null
|
|
|
|
# created_at :datetime not null
|
|
|
|
# updated_at :datetime not null
|
2012-10-09 10:14:17 +02:00
|
|
|
#
|
|
|
|
|
2012-02-15 21:02:33 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe ProtectedBranch do
|
2012-05-11 00:43:12 +02:00
|
|
|
describe 'Associations' do
|
|
|
|
it { should belong_to(:project) }
|
|
|
|
end
|
|
|
|
|
2012-09-26 20:17:17 +02:00
|
|
|
describe "Mass assignment" do
|
|
|
|
it { should_not allow_mass_assignment_of(:project_id) }
|
|
|
|
end
|
|
|
|
|
2012-05-11 00:43:12 +02:00
|
|
|
describe 'Validation' do
|
2012-10-09 02:10:16 +02:00
|
|
|
it { should validate_presence_of(:project) }
|
2012-05-11 00:43:12 +02:00
|
|
|
it { should validate_presence_of(:name) }
|
|
|
|
end
|
2012-02-15 21:02:33 +01:00
|
|
|
end
|