Skip to content

Commit

Permalink
Deprecate orders/could_not_transition view
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielePalombo committed Jul 10, 2020
1 parent 18b5370 commit e51fe03
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# frozen_string_literal: true

Spree::Deprecation.warn(
'spree/api/orders/could_not_transition is deprecated.' \
' Please use spree/api/errors/could_not_transition'
)

json.error(I18n.t(:could_not_transition, scope: "spree.api.order"))
json.errors(@order.errors.to_hash)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true

require "spec_helper"

RSpec.describe 'spree/api/orders/could_not_transition.json.jbuilder' do
helper(Spree::Api::ApiHelpers)

let(:template_deprecation_error) do
'spree/api/orders/could_not_transition is deprecated.' \
' Please use spree/api/errors/could_not_transition'
end

it 'shows a deprecation error' do
assign(:order, instance_double(Spree::Order, errors: {}))

expect(Spree::Deprecation).to receive(:warn).with(template_deprecation_error)

render
end
end

0 comments on commit e51fe03

Please sign in to comment.