protected_branch_spec.rb 638 Bytes
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1 2 3 4
# == Schema Information
#
# Table name: protected_branches
#
5 6 7 8 9
#  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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
10 11
#

12 13 14
require 'spec_helper'

describe ProtectedBranch do
Robb Kidd's avatar
Robb Kidd committed
15 16 17 18
  describe 'Associations' do
    it { should belong_to(:project) }
  end

19 20 21 22
  describe "Mass assignment" do
    it { should_not allow_mass_assignment_of(:project_id) }
  end

Robb Kidd's avatar
Robb Kidd committed
23
  describe 'Validation' do
Andrey Kumanyaev's avatar
Andrey Kumanyaev committed
24
    it { should validate_presence_of(:project) }
Robb Kidd's avatar
Robb Kidd committed
25 26
    it { should validate_presence_of(:name) }
  end
27
end