Sha256: f2de13ad3efa3d820927cf9d8b4a7d832d8fe9094d2b04c312b393baf47d67e4

Contents?: true

Size: 725 Bytes

Versions: 10

Compression:

Stored size: 725 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, 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, exhibit_id: exhibit, attachment: { name: 'xyz' }
        expect(response).to be_successful
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
blacklight-spotlight-0.23.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.22.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.21.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.20.3 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.20.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.20.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.20.0 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.19.2 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.19.1 spec/controllers/spotlight/attachments_controller_spec.rb
blacklight-spotlight-0.19.0 spec/controllers/spotlight/attachments_controller_spec.rb