provider_spec.rb - warvox - VoIP based wardialing tool, forked from rapid7/warvox.
HTML git clone git://jay.scot/warvox
DIR Log
DIR Files
DIR Refs
DIR README
---
provider_spec.rb (1129B)
---
1 # == Schema Information
2 #
3 # Table name: providers
4 #
5 # id :integer not null, primary key
6 # created_at :datetime
7 # updated_at :datetime
8 # name :text not null
9 # host :text not null
10 # port :integer not null
11 # user :text
12 # pass :text
13 # lines :integer default(1), not null
14 # enabled :boolean default(TRUE)
15 #
16
17 require 'rails_helper'
18
19 RSpec.describe Provider, type: :model do
20 ## TODO determine if association is unecessary
21 # the DialResult model does not exist
22 #it { should have_many(:dial_results) }
23
24 it { should validate_presence_of(:name) }
25 it { should validate_presence_of(:host) }
26 it { should validate_presence_of(:port) }
27 it { should validate_presence_of(:user) }
28 it { should validate_presence_of(:pass) }
29 it { should validate_presence_of(:lines) }
30 it { should validate_numericality_of(:port).is_less_than(65536).is_greater_than(0) }
31 it { should validate_numericality_of(:lines).is_less_than(255).is_greater_than(0) }
32
33 it "valid record" do
34 expect(build(:provider)).to be_valid
35 end
36 end