Sha256: d495236894296382447507bb7ce53a151b8d8c1a306b35942a4808d277bb69b1

Contents?: true

Size: 591 Bytes

Versions: 8

Compression:

Stored size: 591 Bytes

Contents

describe 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, 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 & 1 rubygems

Version Path
sufia-7.1.0 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0.rc2 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0.rc1 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0.beta4 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0.beta3 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0.beta2 spec/controllers/featured_work_lists_controller_spec.rb
sufia-7.0.0.beta1 spec/controllers/featured_work_lists_controller_spec.rb