Icecast test models

This commit is contained in:
jam 2014-01-07 14:30:06 -06:00
parent 932f59cea6
commit 66558b70e9
13 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,20 @@
require 'spec_helper'
describe IcecastAdminAuthentication do
let(:admin) { IcecastAdminAuthentication.new }
before(:all) do
end
it "save" do
admin.save.should be_true
end
it "non-string password should be checked" do
admin.source_password = 1
admin.save.should be_false
admin.errors[:source_password].should == ['is not a string']
end
end

View File

@ -0,0 +1,20 @@
require 'spec_helper'
describe IcecastLimit do
let(:limit) { IcecastLimit.new }
before(:all) do
end
it "save" do
limit.save.should be_true
end
it "non-integer clients should be checked" do
limit.clients = "a"
limit.save.should be_false
limit.errors[:clients].should == ['is not a number']
end
end