Sha256: 3446d20ab656368dc1506a563e124dd2e1cc6bb378c87f31d0aefd8d33caaba1

Contents?: true

Size: 874 Bytes

Versions: 32

Compression:

Stored size: 874 Bytes

Contents

require 'spec_helper'

describe Spree::Admin::ReturnItemsController, type: :controller do
  stub_authorization!

  describe '#update' do
    let(:customer_return) { create(:customer_return) }
    let(:return_item) { customer_return.return_items.first }
    let(:old_acceptance_status) { 'pending' }
    let(:new_acceptance_status) { 'rejected' }

    subject do
      put :update, params: { id: return_item.to_param, return_item: { acceptance_status: new_acceptance_status } }
    end

    it 'updates the return item' do
      expect {
        subject
      }.to change { return_item.reload.acceptance_status }.from(old_acceptance_status).to(new_acceptance_status)
    end

    it 'redirects to the customer return' do
      subject
      expect(response).to redirect_to spree.edit_admin_order_customer_return_path(customer_return.order, customer_return)
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
solidus_backend-2.5.2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.5.1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.5.0 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.5.0.rc1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.5.0.beta2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.5.0.beta1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.4.2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.4.1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.3.1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.2.2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.1.1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.0.3 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.4.0 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.4.0.rc1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.4.0.beta1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.3.0 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.3.0.rc3 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.3.0.rc2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.3.0.rc1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.3.0.beta1 spec/controllers/spree/admin/return_items_controller_spec.rb