require 'spec_helper'

describe ApiIcecastController, type: :controller do
  render_views

  let(:user) {FactoryGirl.create(:user) }

  before(:each) do
    controller.current_user = user
  end

  describe "create_source_change" do
    let!(:mount) {FactoryGirl.create(:iceast_mount_with_music_session, sourced: true, sourced_needs_changing_at: nil, listeners: 1)}

    it "success" do

      post :create_source_change, {format:'json', id: mount.id, success: true, source_direction: true, reason: 'blah', client_id: 'abc'}

      response.status.should == 200
    end
  end

end
