Sha256: 5fa3411c7c83974982de853bef38e0dedac6df4a8b06c0e33a837fd994580e60

Contents?: true

Size: 600 Bytes

Versions: 8

Compression:

Stored size: 600 Bytes

Contents

describe Hyrax::FeaturedWorkListsController, type: :controller do
  describe "#create" do
    before do
      expect(controller).to receive(:authorize!).with(:update, FeaturedWork)
    end

    let(:feature1) { FactoryGirl.create(:featured_work) }
    let(:feature2) { FactoryGirl.create(:featured_work) }

    it "is successful" do
      post :create, params: {
        format: :json,
        featured_work_list: {
          featured_works_attributes: [{ id: feature1.id, order: "2" }, { id: feature2.id, order: "1" }]
        }
      }
      expect(feature1.reload.order).to eq 2
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
hyrax-1.0.5 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
hyrax-1.0.4 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
hyrax-1.0.3 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
hyrax-1.0.2 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
hyrax-1.0.1 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
hyrax-1.0.0.rc2 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
hyrax-1.0.0.rc1 spec/controllers/hyrax/featured_work_lists_controller_spec.rb
test_hyrax-0.0.1.alpha spec/controllers/hyrax/featured_work_lists_controller_spec.rb