29 lines
528 B
Ruby
29 lines
528 B
Ruby
require 'spec_helper'
|
|
|
|
describe IcecastLimit do
|
|
|
|
let(:limit) { IcecastLimit.new }
|
|
|
|
before(:all) do
|
|
|
|
end
|
|
|
|
it "save" do
|
|
limit.clients = 9999
|
|
limit.save
|
|
puts limit.inspect
|
|
#limit.dumpXml
|
|
limit.errors.any?.should be_false
|
|
v = IcecastLimit.find(limit.id)
|
|
puts v.inspect
|
|
end
|
|
|
|
it "non-integer clients should be checked" do
|
|
limit.setclients 'a'
|
|
puts limit.clients
|
|
puts limit.inspect
|
|
limit.save.should be_false
|
|
limit.errors[:clients].should == ['is not a number']
|
|
end
|
|
end
|