require 'spec_helper'

describe IcecastTemplate do

  let(:template) { template = FactoryGirl.create(:icecast_template_minimal) }

  it "save" do
    template.errors.any?.should be_false
  end

  describe "poke configs" do
    let(:server) { a = FactoryGirl.create(:icecast_server_with_overrides); a.config_updated; IcecastServer.find(a.id) }

    it "success via template" do
      server.template.save!
      server.reload
      server.config_changed.should == 1
    end
  end
end
