require "rails_helper"

describe VideoAnalysisPolicy do
  let(:user) { build(:user) }
  let(:user_context) { build(:user_context, user: user, account: user.primary_account) }

  subject { described_class }

  permissions :create? do
    it { is_expected.not_to permit(user_context, VideoAnalysis ) }

    context "as an admin" do
      let(:user) { build(:user, :admin) }
      
      it { is_expected.to permit(user_context, VideoAnalysis) }
    end
  end

  permissions :show? do
    it { is_expected.not_to permit(user_context, VideoAnalysis) }

    context "as an admin" do
      let(:user) { build(:user, :admin) }
      
      it { is_expected.to permit(user_context, VideoAnalysis) }
    end
  end
end
