Sha256: 598cfc8fec230abb924ff95e37699978afc1f2a3d90f329b0f8fca3a596d76f9

Contents?: true

Size: 869 Bytes

Versions: 16

Compression:

Stored size: 869 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) { 'accepted' }
    let(:new_acceptance_status) { 'rejected' }

    subject do
      spree_put :update, 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 custome 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

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-3.1.5 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.4 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.3 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.2 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.0.10 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.1 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.0 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.0.rc4 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.0.9 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.0.rc3 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.0.rc2 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.1.0.rc1 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.0.8 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.0.7 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.0.6.1 spec/controllers/spree/admin/return_items_controller_spec.rb
spree_backend-3.0.6 spec/controllers/spree/admin/return_items_controller_spec.rb