Sha256: 1486eec8f719e747388016f1b26bfac413c2d44b838ba64d812e6fba8971b0d7

Contents?: true

Size: 749 Bytes

Versions: 23

Compression:

Stored size: 749 Bytes

Contents

describe Spotlight::AttachmentsController, type: :controller do
  routes { Spotlight::Engine.routes }
  let(:exhibit) { FactoryGirl.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) { FactoryGirl.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

23 entries across 23 versions & 1 rubygems

Version Path
blacklight-spotlight-1.0.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.34.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.34.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.33.3 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.33.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.33.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.33.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.32.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.31.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.30.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.29.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.29.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.28.3 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.28.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.28.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.28.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.27.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.26.1 spec/controllers/spotlight/attachments_controller_spec.rb