Sha256: 25e483f323374a203796c4c70b1deaed53febf4c228f89dee754744ccb510196

Contents?: true

Size: 909 Bytes

Versions: 18

Compression:

Stored size: 909 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::PermissionsController do
  let(:user) { create(:user) }
  before { sign_in user }

  describe '#confirm' do
    let(:generic_work) { create(:generic_work, user: user) }

    it 'draws the page' do
      get :confirm, params: { id: generic_work }
      expect(response).to be_success
    end
  end

  describe '#copy' do
    let(:generic_work) { create(:generic_work, user: user) }

    it 'adds a worker to the queue' do
      expect(VisibilityCopyJob).to receive(:perform_later).with(generic_work)
      post :copy, params: { id: generic_work }
      expect(response).to redirect_to main_app.curation_concerns_generic_work_path(generic_work)
      expect(flash[:notice]).to eq 'Updating file permissions. This may take a few minutes. You may want to refresh your browser or return to this record later to see the updated file permissions.'
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.7 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-2.0.0 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-2.0.0.rc2 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.6 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.5 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.4 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.3 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.2 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-2.0.0.rc1 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.1 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.0 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.7.0.beta1 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.6.3 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.6.2 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.6.1 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.6.0 spec/controllers/curation_concerns/permissions_controller_spec.rb
curation_concerns-1.5.0 spec/controllers/curation_concerns/permissions_controller_spec.rb