33 lines
1.1 KiB
Ruby
33 lines
1.1 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe IcecastServer do
|
|
|
|
let(:server) { IcecastServer.new }
|
|
let(:output) { StringIO.new }
|
|
let(:builder) { ::Builder::XmlMarkup.new(:target => output, :indent => 1) }
|
|
|
|
|
|
it "save" do
|
|
server = FactoryGirl.create(:icecast_server_minimal)
|
|
server.save!
|
|
server.reload
|
|
server.dumpXml(output)
|
|
|
|
output.rewind
|
|
|
|
xml = Nokogiri::XML(output)
|
|
xml.css('icecast hostname').text.should == server.hostname
|
|
xml.css('icecast server-id').text.should == server.server_id
|
|
xml.css('icecast location').text.should == server.template.location
|
|
xml.css('icecast admin').text.should == server.template.admin_email
|
|
xml.css('icecast fileserve').text.should == server.template.fileserve.to_s
|
|
xml.css('icecast limits').length.should == 1
|
|
xml.css('icecast authentication').length.should == 1
|
|
xml.css('icecast directory').length.should == 0
|
|
xml.css('icecast master-server').length.should == 0
|
|
xml.css('icecast paths').length.should == 1
|
|
xml.css('icecast logging').length.should == 1
|
|
xml.css('icecast security').length.should == 1
|
|
xml.css('icecast listen-socket').length.should == 1
|
|
end
|
|
end |