solidus_frontend 1.0.7 → 1.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_frontend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/frontend/checkout/address.js.coffee +6 -5
- data/app/controllers/spree/checkout_controller.rb +5 -3
- data/app/controllers/spree/store_controller.rb +2 -1
- data/app/views/spree/address/_form.html.erb +15 -15
- data/lib/spree/frontend.rb +0 -2
- metadata +9 -79
- data/CHANGELOG.md +0 -1
- data/Gemfile +0 -6
- data/Rakefile +0 -15
- data/lib/spree/frontend/preference_rescue.rb +0 -25
- data/script/rails +0 -9
- data/solidus_frontend.gemspec +0 -30
- data/spec/controllers/controller_extension_spec.rb +0 -126
- data/spec/controllers/controller_helpers_spec.rb +0 -26
- data/spec/controllers/spree/checkout_controller_spec.rb +0 -447
- data/spec/controllers/spree/checkout_controller_with_views_spec.rb +0 -36
- data/spec/controllers/spree/content_controller_spec.rb +0 -7
- data/spec/controllers/spree/current_order_tracking_spec.rb +0 -44
- data/spec/controllers/spree/home_controller_spec.rb +0 -27
- data/spec/controllers/spree/orders_controller_ability_spec.rb +0 -104
- data/spec/controllers/spree/orders_controller_spec.rb +0 -134
- data/spec/controllers/spree/orders_controller_transitions_spec.rb +0 -31
- data/spec/controllers/spree/products_controller_spec.rb +0 -36
- data/spec/controllers/spree/taxons_controller_spec.rb +0 -12
- data/spec/features/address_spec.rb +0 -76
- data/spec/features/automatic_promotion_adjustments_spec.rb +0 -47
- data/spec/features/caching/products_spec.rb +0 -55
- data/spec/features/caching/taxons_spec.rb +0 -22
- data/spec/features/cart_spec.rb +0 -81
- data/spec/features/checkout_spec.rb +0 -513
- data/spec/features/checkout_unshippable_spec.rb +0 -35
- data/spec/features/coupon_code_spec.rb +0 -227
- data/spec/features/currency_spec.rb +0 -18
- data/spec/features/free_shipping_promotions_spec.rb +0 -59
- data/spec/features/locale_spec.rb +0 -60
- data/spec/features/order_spec.rb +0 -73
- data/spec/features/products_spec.rb +0 -260
- data/spec/features/promotion_code_invalidation_spec.rb +0 -51
- data/spec/features/quantity_promotions_spec.rb +0 -128
- data/spec/features/taxons_spec.rb +0 -135
- data/spec/features/template_rendering_spec.rb +0 -19
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/helpers/base_helper_spec.rb +0 -11
- data/spec/spec_helper.rb +0 -121
- data/spec/support/shared_contexts/checkout_setup.rb +0 -9
- data/spec/support/shared_contexts/custom_products.rb +0 -25
- data/spec/support/shared_contexts/product_prototypes.rb +0 -30
- data/spec/views/spree/checkout/_summary_spec.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aef95541ce55ae65eb3f48f04ced3fc99e333c10
|
4
|
+
data.tar.gz: c4d27a4c94dae740f03711efb1eb6b2496c4b760
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83e0ceac48b02e4eb053b0732e915ff97180c5ecd508bb970b72ac83881031b1fc5a49b743abe91a7f54de5e8400942b90d6af28ef6db730a2aa32fae5b97bd
|
7
|
+
data.tar.gz: f8264d48702fcf8fc86718f3fcb0c8be1371f34c7aef7d3968df76ccfb8d9bad968b7e7ddb2f2898716ac0c8438396b76ee3a6a9fc074f63925851073180673b
|
@@ -1,8 +1,5 @@
|
|
1
1
|
$ ->
|
2
2
|
if $('#checkout_form_address').is('*')
|
3
|
-
# Hidden by default to support browsers with javascript disabled
|
4
|
-
$('.js-address-fields').show()
|
5
|
-
|
6
3
|
$('#checkout_form_address').validate()
|
7
4
|
|
8
5
|
getCountryId = (region) ->
|
@@ -46,8 +43,12 @@ $ ->
|
|
46
43
|
stateSelect.prop('disabled', false).show()
|
47
44
|
stateInput.hide().prop 'disabled', true
|
48
45
|
statePara.show()
|
49
|
-
|
50
|
-
|
46
|
+
if statesRequired
|
47
|
+
stateSelect.addClass('required')
|
48
|
+
stateSpanRequired.show()
|
49
|
+
else
|
50
|
+
stateSelect.removeClass('required')
|
51
|
+
stateSpanRequired.hide()
|
51
52
|
stateSelect.removeClass('hidden')
|
52
53
|
stateInput.removeClass('required')
|
53
54
|
else
|
@@ -25,7 +25,8 @@ module Spree
|
|
25
25
|
|
26
26
|
# Updates the order and advances to the next state (when possible.)
|
27
27
|
def update
|
28
|
-
|
28
|
+
massaged_params = move_payment_source_into_payments_attributes(params)
|
29
|
+
if @order.update_from_params(massaged_params, permitted_checkout_attributes, request.headers.env)
|
29
30
|
@order.temporary_address = !params[:save_user_address]
|
30
31
|
success = if @order.state == 'confirm'
|
31
32
|
@order.complete
|
@@ -116,8 +117,9 @@ module Spree
|
|
116
117
|
def before_address
|
117
118
|
# if the user has a default address, a callback takes care of setting
|
118
119
|
# that; but if he doesn't, we need to build an empty one here
|
119
|
-
|
120
|
-
@order.
|
120
|
+
default = {country_id: Country.default.id}
|
121
|
+
@order.build_bill_address(default) unless @order.bill_address
|
122
|
+
@order.build_ship_address(default) if @order.checkout_steps.include?('delivery') && !@order.ship_address
|
121
123
|
end
|
122
124
|
|
123
125
|
def before_delivery
|
@@ -38,24 +38,24 @@
|
|
38
38
|
<% have_states = !address.country.states.empty? %>
|
39
39
|
<%= form.label :state, Spree.t(:state) %><span class='required' id=<%="#{address_id}state-required"%>>*</span><br/>
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
41
|
+
<% state_elements = [
|
42
|
+
form.collection_select(:state_id, address.country.states,
|
43
|
+
:id, :name,
|
44
|
+
{:include_blank => true},
|
45
|
+
{:class => have_states ? 'required' : 'hidden',
|
46
|
+
:disabled => !have_states}) +
|
47
|
+
form.text_field(:state_name,
|
48
|
+
:class => !have_states ? 'required' : 'hidden',
|
49
|
+
:disabled => have_states)
|
50
|
+
].join.gsub('"', "'").gsub("\n", "")
|
51
|
+
%>
|
52
|
+
<%= javascript_tag do -%>
|
53
|
+
$('#<%="#{address_id}state" %>').append("<%== state_elements %>");
|
54
|
+
<% end %>
|
55
|
+
</p>
|
55
56
|
<noscript>
|
56
57
|
<%= form.text_field :state_name, :class => 'required' %>
|
57
58
|
</noscript>
|
58
|
-
</p>
|
59
59
|
<% end %>
|
60
60
|
|
61
61
|
<p class="field" id=<%="#{address_id}zipcode" %>>
|
data/lib/spree/frontend.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_frontend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.1.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.
|
19
|
+
version: 1.1.0.beta1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.0.
|
26
|
+
version: 1.1.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solidus_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.0.
|
33
|
+
version: 1.1.0.beta1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.0.
|
40
|
+
version: 1.1.0.beta1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: canonical-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,34 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: sass-rails
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: coffee-rails
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
97
69
|
- !ruby/object:Gem::Dependency
|
98
70
|
name: capybara-accessible
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,11 +86,8 @@ executables: []
|
|
114
86
|
extensions: []
|
115
87
|
extra_rdoc_files: []
|
116
88
|
files:
|
117
|
-
- CHANGELOG.md
|
118
|
-
- Gemfile
|
119
89
|
- LICENSE
|
120
90
|
- README.md
|
121
|
-
- Rakefile
|
122
91
|
- app/assets/images/credit_cards/amex_cid.gif
|
123
92
|
- app/assets/images/credit_cards/credit_card.gif
|
124
93
|
- app/assets/images/credit_cards/discover_cid.gif
|
@@ -221,48 +190,9 @@ files:
|
|
221
190
|
- lib/spree/frontend.rb
|
222
191
|
- lib/spree/frontend/engine.rb
|
223
192
|
- lib/spree/frontend/middleware/seo_assist.rb
|
224
|
-
- lib/spree/frontend/preference_rescue.rb
|
225
193
|
- lib/spree_frontend.rb
|
226
194
|
- lib/tasks/rake_util.rb
|
227
195
|
- lib/tasks/taxon.rake
|
228
|
-
- script/rails
|
229
|
-
- solidus_frontend.gemspec
|
230
|
-
- spec/controllers/controller_extension_spec.rb
|
231
|
-
- spec/controllers/controller_helpers_spec.rb
|
232
|
-
- spec/controllers/spree/checkout_controller_spec.rb
|
233
|
-
- spec/controllers/spree/checkout_controller_with_views_spec.rb
|
234
|
-
- spec/controllers/spree/content_controller_spec.rb
|
235
|
-
- spec/controllers/spree/current_order_tracking_spec.rb
|
236
|
-
- spec/controllers/spree/home_controller_spec.rb
|
237
|
-
- spec/controllers/spree/orders_controller_ability_spec.rb
|
238
|
-
- spec/controllers/spree/orders_controller_spec.rb
|
239
|
-
- spec/controllers/spree/orders_controller_transitions_spec.rb
|
240
|
-
- spec/controllers/spree/products_controller_spec.rb
|
241
|
-
- spec/controllers/spree/taxons_controller_spec.rb
|
242
|
-
- spec/features/address_spec.rb
|
243
|
-
- spec/features/automatic_promotion_adjustments_spec.rb
|
244
|
-
- spec/features/caching/products_spec.rb
|
245
|
-
- spec/features/caching/taxons_spec.rb
|
246
|
-
- spec/features/cart_spec.rb
|
247
|
-
- spec/features/checkout_spec.rb
|
248
|
-
- spec/features/checkout_unshippable_spec.rb
|
249
|
-
- spec/features/coupon_code_spec.rb
|
250
|
-
- spec/features/currency_spec.rb
|
251
|
-
- spec/features/free_shipping_promotions_spec.rb
|
252
|
-
- spec/features/locale_spec.rb
|
253
|
-
- spec/features/order_spec.rb
|
254
|
-
- spec/features/products_spec.rb
|
255
|
-
- spec/features/promotion_code_invalidation_spec.rb
|
256
|
-
- spec/features/quantity_promotions_spec.rb
|
257
|
-
- spec/features/taxons_spec.rb
|
258
|
-
- spec/features/template_rendering_spec.rb
|
259
|
-
- spec/fixtures/thinking-cat.jpg
|
260
|
-
- spec/helpers/base_helper_spec.rb
|
261
|
-
- spec/spec_helper.rb
|
262
|
-
- spec/support/shared_contexts/checkout_setup.rb
|
263
|
-
- spec/support/shared_contexts/custom_products.rb
|
264
|
-
- spec/support/shared_contexts/product_prototypes.rb
|
265
|
-
- spec/views/spree/checkout/_summary_spec.rb
|
266
196
|
- vendor/assets/images/datepicker/cal.gif
|
267
197
|
- vendor/assets/images/flags/ad.png
|
268
198
|
- vendor/assets/images/flags/ae.png
|
@@ -579,13 +509,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
579
509
|
version: 2.1.0
|
580
510
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
581
511
|
requirements:
|
582
|
-
- - "
|
512
|
+
- - ">"
|
583
513
|
- !ruby/object:Gem::Version
|
584
|
-
version:
|
514
|
+
version: 1.3.1
|
585
515
|
requirements:
|
586
516
|
- none
|
587
517
|
rubyforge_project: solidus_frontend
|
588
|
-
rubygems_version: 2.
|
518
|
+
rubygems_version: 2.4.5
|
589
519
|
signing_key:
|
590
520
|
specification_version: 4
|
591
521
|
summary: Cart and storefront for the Solidus e-commerce project.
|
data/CHANGELOG.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
## Spree 2.4.0 (unreleased) ##
|
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
require 'spree/testing_support/common_rake'
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new
|
8
|
-
|
9
|
-
task :default => :spec
|
10
|
-
|
11
|
-
desc "Generates a dummy app for testing"
|
12
|
-
task :test_app do
|
13
|
-
ENV['LIB_NAME'] = 'spree/frontend'
|
14
|
-
Rake::Task['common:test_app'].invoke
|
15
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
class OldPrefs < ActiveRecord::Base
|
3
|
-
self.table_name = "spree_preferences"
|
4
|
-
belongs_to :owner, :polymorphic => true
|
5
|
-
attr_accessor :owner_klass
|
6
|
-
end
|
7
|
-
|
8
|
-
class PreferenceRescue
|
9
|
-
def self.try
|
10
|
-
OldPrefs.where(:key => nil).each do |old_pref|
|
11
|
-
next unless owner = (old_pref.owner rescue nil)
|
12
|
-
unless old_pref.owner_type == "Spree::Activator" || old_pref.owner_type == "Spree::Configuration"
|
13
|
-
begin
|
14
|
-
old_pref.key = [owner.class.name, old_pref.name, owner.id].join('::').underscore
|
15
|
-
old_pref.value_type = owner.preference_type(old_pref.name)
|
16
|
-
puts "Migrating Preference: #{old_pref.key}"
|
17
|
-
old_pref.save
|
18
|
-
rescue NoMethodError => ex
|
19
|
-
puts ex.message
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/script/rails
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
-
ENGINE_PATH = File.expand_path('../../lib/spree/frontend/engine', __FILE__)
|
6
|
-
|
7
|
-
require 'rails/all'
|
8
|
-
require 'rails/engine/commands'
|
9
|
-
|
data/solidus_frontend.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
version = File.read(File.expand_path("../../SOLIDUS_VERSION", __FILE__)).strip
|
3
|
-
|
4
|
-
Gem::Specification.new do |s|
|
5
|
-
s.platform = Gem::Platform::RUBY
|
6
|
-
s.name = 'solidus_frontend'
|
7
|
-
s.version = version
|
8
|
-
s.summary = 'Cart and storefront for the Solidus e-commerce project.'
|
9
|
-
s.description = s.summary
|
10
|
-
|
11
|
-
s.required_ruby_version = '>= 2.1.0'
|
12
|
-
s.author = 'Solidus Team'
|
13
|
-
s.email = 'contact@solidus.io'
|
14
|
-
s.homepage = 'http://solidus.io/'
|
15
|
-
s.rubyforge_project = 'solidus_frontend'
|
16
|
-
|
17
|
-
s.files = `git ls-files`.split("\n")
|
18
|
-
s.require_path = 'lib'
|
19
|
-
s.requirements << 'none'
|
20
|
-
|
21
|
-
s.add_dependency 'solidus_api', version
|
22
|
-
s.add_dependency 'solidus_core', version
|
23
|
-
|
24
|
-
s.add_dependency 'canonical-rails', '~> 0.0.4'
|
25
|
-
s.add_dependency 'jquery-rails'
|
26
|
-
s.add_dependency 'sass-rails'
|
27
|
-
s.add_dependency 'coffee-rails'
|
28
|
-
|
29
|
-
s.add_development_dependency 'capybara-accessible'
|
30
|
-
end
|
@@ -1,126 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
# This test tests the functionality within
|
4
|
-
# spree/core/controller_helpers/respond_with.rb
|
5
|
-
# Rather than duck-punching the existing controllers, let's define a custom one:
|
6
|
-
class Spree::CustomController < Spree::BaseController
|
7
|
-
def index
|
8
|
-
respond_with(Spree::Address.new) do |format|
|
9
|
-
format.html { render :text => "neutral" }
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def create
|
14
|
-
# Just need a model with validations
|
15
|
-
# Address is good enough, so let's go with that
|
16
|
-
address = Spree::Address.new(params[:address])
|
17
|
-
respond_with(address)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe Spree::CustomController, :type => :controller do
|
22
|
-
after do
|
23
|
-
Spree::CustomController.clear_overrides!
|
24
|
-
end
|
25
|
-
|
26
|
-
before do
|
27
|
-
@routes = ActionDispatch::Routing::RouteSet.new.tap do |r|
|
28
|
-
r.draw {
|
29
|
-
get 'index', to: 'spree/custom#index'
|
30
|
-
post 'create', to: 'spree/custom#create'
|
31
|
-
}
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
context "extension testing" do
|
36
|
-
context "index" do
|
37
|
-
context "specify symbol for handler instead of Proc" do
|
38
|
-
before do
|
39
|
-
Spree::CustomController.class_eval do
|
40
|
-
respond_override({:index => {:html => {:success => :success_method}}})
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def success_method
|
45
|
-
render :text => 'success!!!'
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe "GET" do
|
51
|
-
it "has value success" do
|
52
|
-
spree_get :index
|
53
|
-
expect(response).to be_success
|
54
|
-
assert (response.body =~ /success!!!/)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
context "render" do
|
60
|
-
before do
|
61
|
-
Spree::CustomController.instance_eval do
|
62
|
-
respond_override({:index => {:html => {:success => lambda { render(:text => 'success!!!') }}}})
|
63
|
-
respond_override({:index => {:html => {:failure => lambda { render(:text => 'failure!!!') }}}})
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
describe "GET" do
|
68
|
-
it "has value success" do
|
69
|
-
spree_get :index
|
70
|
-
expect(response).to be_success
|
71
|
-
assert (response.body =~ /success!!!/)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
context "redirect" do
|
77
|
-
before do
|
78
|
-
Spree::CustomController.instance_eval do
|
79
|
-
respond_override({:index => {:html => {:success => lambda { redirect_to('/cart') }}}})
|
80
|
-
respond_override({:index => {:html => {:failure => lambda { render(:text => 'failure!!!') }}}})
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
describe "GET" do
|
85
|
-
it "has value success" do
|
86
|
-
spree_get :index
|
87
|
-
expect(response).to be_redirect
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
context "validation error" do
|
93
|
-
before do
|
94
|
-
Spree::CustomController.instance_eval do
|
95
|
-
respond_to :html
|
96
|
-
respond_override({:create => {:html => {:success => lambda { render(:text => 'success!!!') }}}})
|
97
|
-
respond_override({:create => {:html => {:failure => lambda { render(:text => 'failure!!!') }}}})
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
describe "POST" do
|
102
|
-
it "has value success" do
|
103
|
-
spree_post :create
|
104
|
-
expect(response).to be_success
|
105
|
-
assert (response.body =~ /success!/)
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
context 'A different controllers respond_override. Regression test for #1301' do
|
111
|
-
before do
|
112
|
-
Spree::CheckoutController.instance_eval do
|
113
|
-
respond_override({:index => {:html => {:success => lambda { render(:text => 'success!!!') }}}})
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
describe "POST" do
|
118
|
-
it "should not effect the wrong controller" do
|
119
|
-
spree_get :index
|
120
|
-
assert (response.body =~ /neutral/)
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|