Sha256: 50a5d4c4a9cfcdadd696f5c916b6909c78da65f64b0155a7e95a153e1eea2609

Contents?: true

Size: 905 Bytes

Versions: 47

Compression:

Stored size: 905 Bytes

Contents

# frozen_string_literal: true

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

47 entries across 47 versions & 2 rubygems

Version Path
solidus_backend-2.10.5 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.10.3 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.10.2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.6 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.8.6 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.10.1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.5 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.10.0 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.4 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.6.6 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.7.4 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.8.5 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.3 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.2 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.10.0.beta1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.7.3 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.6.5 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.1 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.0 spec/controllers/spree/admin/return_items_controller_spec.rb
solidus_backend-2.9.0.rc.1 spec/controllers/spree/admin/return_items_controller_spec.rb