Sha256: 5654ce4b0fc6fc1a3b842f26580b72e6b754d53a8aa59c1d6c64b1dc1bfd83d2

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe Hyrax::RasterWorksController, type: :controller do
  let(:user) { FactoryGirl.create(:user) }
  let(:raster_work) { FactoryGirl.create(:raster_work, user: user, title: ['Raster Work Title']) }
  let(:reloaded) { raster_work.reload }
  let!(:sipity_entity) do
    create(:sipity_entity, proxy_for_global_id: raster_work.to_global_id.to_s)
  end

  describe "#show" do
    before do
      sign_in user
    end
    context "when there's a parent image work" do
      let(:parent_image_work) { FactoryGirl.create(:image_work, user: user) }
      let!(:parent_sipity_entity) do
        create(:sipity_entity, proxy_for_global_id: parent_image_work.to_global_id.to_s)
      end
      it "is a success" do
        parent_image_work.ordered_members << raster_work
        parent_image_work.save
        raster_work.update_index

        get :show, params: { id: raster_work.id }
        expect(response).to be_success
      end
    end
  end

  describe "#show_presenter" do
    it "is a raster work show presenter" do
      expect(described_class.new.show_presenter).to eq(GeoWorks::RasterWorkShowPresenter)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geo_works-0.2.0 spec/controllers/raster_works_controller_spec.rb
geo_works-0.1.4 spec/controllers/raster_works_controller_spec.rb
geo_works-0.1.3 spec/controllers/raster_works_controller_spec.rb
geo_works-0.1.2 spec/controllers/raster_works_controller_spec.rb
geo_works-0.1.1 spec/controllers/raster_works_controller_spec.rb
geo_works-0.1.0 spec/controllers/raster_works_controller_spec.rb