Sha256: f2813a70e1788c13a4eebe06af265784423223e711facbb5abcf8a8f44fe6278

Contents?: true

Size: 778 Bytes

Versions: 18

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

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

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-3.0.0.alpha.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.13.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.12.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.12.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.11.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.10.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.9.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.8.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.7.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.7.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.7.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.6.1.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.6.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.6.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.5.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.5.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-2.5.0 spec/controllers/spotlight/attachments_controller_spec.rb