Sha256: 93fd27cac5b9d31c2aaf223186cb9f7023a05bbe00416f9c79f48676f71f4c22

Contents?: true

Size: 747 Bytes

Versions: 24

Compression:

Stored size: 747 Bytes

Contents

describe Spotlight::AttachmentsController, type: :controller do
  routes { Spotlight::Engine.routes }
  let(:exhibit) { FactoryBot.create(:exhibit) }
  describe 'when not logged in' do
    describe 'GET edit' do
      it 'is successful' do
        post :create, params: { exhibit_id: exhibit }
        expect(response).to redirect_to main_app.new_user_session_path
      end
    end
  end

  describe 'when signed in as a curator' do
    let(:user) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
    before { sign_in user }

    describe 'POST create' do
      it 'is successful' do
        post :create, params: { exhibit_id: exhibit, attachment: { name: 'xyz' } }
        expect(response).to be_successful
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
blacklight-spotlight-2.4.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.4.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.3.3 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.3.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.3.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.3.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.2.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.2.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.1.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-1.5.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-1.4.1 spec/controllers/spotlight/attachments_controller_spec.rb