project_spec.rb - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
 (HTM) git clone git://jay.scot/warvox
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
       ---
       project_spec.rb (820B)
       ---
            1 # == Schema Information
            2 #
            3 # Table name: projects
            4 #
            5 #  id          :integer          not null, primary key
            6 #  created_at  :datetime
            7 #  updated_at  :datetime
            8 #  name        :text             not null
            9 #  description :text
           10 #  included    :text
           11 #  excluded    :text
           12 #  created_by  :string(255)
           13 #
           14 
           15 require 'rails_helper'
           16 
           17 RSpec.describe Project, type: :model do
           18   it { should have_many(:lines).dependent(:delete_all) }
           19   it { should have_many(:line_attributes).dependent(:delete_all) }
           20   it { should have_many(:calls).dependent(:delete_all) }
           21   it { should have_many(:call_media).dependent(:delete_all) }
           22   it { should have_many(:jobs).dependent(:delete_all) }
           23 
           24   it { should validate_presence_of(:name) }
           25   it { should validate_uniqueness_of(:name) }
           26 
           27   it "valid record" do
           28     expect(build(:project)).to be_valid
           29   end
           30 end