Set RAILS_ENV=test on rake test_app

Got weird issues while building dummy apps in extensions because the
dummy development db, which we don't really care about, was not being
dropped and migrations would always fail
Use routing concern for api/config/routes.rb
Make rspec random ordering the extension default
Drop deprecation warning for `relation.sum(&:block)`
Ensure FLOAT::INFINITY resolves to proper json on api
allow product rule to match 'none'

Fixes #4587
Drop shipment address code not used anywhere
Add index to spree_orders for user_id & created_by_id

Addresses potential performance regressions discussed at #4582 in the last_incomplete_spree_order method arising after that method changed in c455e1a

Fixes #4584
Distinct Order.created_between and completed_between methods

Addresses the discussion in https://github.com/spree/spree/issues/4554

Fixes #4577
Give defaults for options on product Importer
remove broken variant "deleted" scope

this "deleted" scope doesn't remove the default "deleted_at: nil" condition so it just produces a query like this:

```sql
SELECT "spree_variants".*
FROM "spree_variants"
WHERE "spree_variants"."deleted_at" IS NULL
AND   "spree_variants"."deleted_at" IS NOT NULL
```

instead you have to use the "only_deleted" scope from the acts_as_paranoid gem
see https://github.com/goncalossilva/acts_as_paranoid/blob/ae0fe74/README.markdown#filtering

example: https://github.com/spree/spree/pull/4562

Fixes #4601
Support existing credit card feature on api#checkout

about #4598
provide consistent sort order for promotions

make pagination sane for promotions.
especially true for postgres which seems to do more to keep its promise that "If sorting is not chosen, the rows will be returned in an unspecified order".
since there are no indexes on this table we just use the primary key with most recent first.

Fixes #4596
Fix thank you message on order completion

Thank you message was no more displayed since it was using a wrong
params to test when order was just completed.
This solve the issue by using flash[:commerce_tracking] param
to test when to display the message. An helper method has been
added to aviod code duplication.
Use a more relavant naming and avoid using useless
'nothing special' string as content of the flash message.

Fixes #4586
Refactor Shipments API & JS.

Conflicts:
	backend/app/assets/javascripts/spree/backend/shipments.js.erb
Remove deprecated orders/shipments api.

Fixes #4523
Fix for #4234.
add jquery.alerts images to backend precompile list

Fixes #4609
make sure we use adjustment_total for the shipping adjustment migrations instead of cost
Fixes #4608
No need to define to_param in Product again

friendly_id already takes care of it