Sha256: aec28c7dd4626f31749b4d3bfe389489391b562020e95ff70e29f1b0857acfce

Contents?: true

Size: 577 Bytes

Versions: 10

Compression:

Stored size: 577 Bytes

Contents

require 'spec_helper'

RSpec.describe Hyrax::AdminController do
  describe '#show' do
    let(:service) { instance_double(Hyrax::AdminSetService, search_results_with_work_count: results) }
    let(:results) { instance_double(Array) }

    before do
      expect(controller).to receive(:authorize!).with(:read, :admin_dashboard).and_return(true)
      allow(Hyrax::AdminSetService).to receive(:new).and_return(service)
    end

    it "is successful" do
      get :show
      expect(response).to be_success
      expect(assigns[:admin_set_rows]).to eq results
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.1.0 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.5 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.4 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.3 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.2 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.1 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.0.rc2 spec/controllers/hyrax/admin_controller_spec.rb
hyrax-1.0.0.rc1 spec/controllers/hyrax/admin_controller_spec.rb
test_hyrax-0.0.1.alpha spec/controllers/hyrax/admin_controller_spec.rb