Sha256: 1aa120e58fc597565e68c745c310bd5b227e9a7a74e4d3b031713015122c05de

Contents?: true

Size: 1.05 KB

Versions: 13

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe Geoblacklight::DownloadController, type: :controller do
  describe '#file' do
    describe 'restricted file' do
      it 'should redirect to login for authentication' do
        get :file, id: 'stanford-jf841ys4828-shapefile', format: 'zip'
        expect(response.status).to eq 401
      end
    end
    describe 'public file' do
      it 'should initiate download' do
        expect(controller).to receive(:render)
        expect(controller).to receive(:send_file)
        get :file, id: 'mit-us-ma-e25zcta5dct-2000-shapefile', format: 'zip'
        expect(response.status).to eq 200
      end
    end
  end
  describe '#show' do
    describe 'restricted file' do
      it 'should redirect to login for authentication' do
        get 'show', id: 'stanford-jf841ys4828', format: 'json'
        expect(response.status).to eq 401
      end
    end
    describe 'public file' do
      it 'should initiate download creation' do
        get 'show', id: 'mit-us-ma-e25zcta5dct-2000'
        expect(response.status).to eq 200
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
geoblacklight-0.3.4 spec/controllers/download_controller_spec.rb
geoblacklight-0.3.3 spec/controllers/download_controller_spec.rb
geoblacklight-0.3.2 spec/controllers/download_controller_spec.rb
geoblacklight-0.3.1 spec/controllers/download_controller_spec.rb
geoblacklight-0.3.0 spec/controllers/download_controller_spec.rb
geoblacklight-0.2.2 spec/controllers/download_controller_spec.rb
geoblacklight-0.2.1 spec/controllers/download_controller_spec.rb
geoblacklight-0.2.0 spec/controllers/download_controller_spec.rb
geoblacklight-0.1.0 spec/controllers/download_controller_spec.rb
geoblacklight-0.0.8 spec/controllers/download_controller_spec.rb
geoblacklight-0.0.7 spec/controllers/download_controller_spec.rb
geoblacklight-0.0.6 spec/controllers/download_controller_spec.rb
geoblacklight-0.0.5 spec/controllers/download_controller_spec.rb