solidus_frontend 1.0.2 → 1.0.3
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/CHANGELOG.md +1 -0
- data/Gemfile +6 -0
- data/Rakefile +15 -0
- data/script/rails +9 -0
- data/solidus_frontend.gemspec +28 -0
- data/spec/controllers/controller_extension_spec.rb +126 -0
- data/spec/controllers/controller_helpers_spec.rb +26 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +401 -0
- data/spec/controllers/spree/checkout_controller_with_views_spec.rb +36 -0
- data/spec/controllers/spree/content_controller_spec.rb +7 -0
- data/spec/controllers/spree/current_order_tracking_spec.rb +44 -0
- data/spec/controllers/spree/home_controller_spec.rb +27 -0
- data/spec/controllers/spree/orders_controller_ability_spec.rb +104 -0
- data/spec/controllers/spree/orders_controller_spec.rb +134 -0
- data/spec/controllers/spree/orders_controller_transitions_spec.rb +31 -0
- data/spec/controllers/spree/products_controller_spec.rb +36 -0
- data/spec/controllers/spree/taxons_controller_spec.rb +12 -0
- data/spec/features/address_spec.rb +76 -0
- data/spec/features/automatic_promotion_adjustments_spec.rb +47 -0
- data/spec/features/caching/products_spec.rb +55 -0
- data/spec/features/caching/taxons_spec.rb +22 -0
- data/spec/features/cart_spec.rb +81 -0
- data/spec/features/checkout_spec.rb +477 -0
- data/spec/features/checkout_unshippable_spec.rb +35 -0
- data/spec/features/coupon_code_spec.rb +227 -0
- data/spec/features/currency_spec.rb +18 -0
- data/spec/features/free_shipping_promotions_spec.rb +59 -0
- data/spec/features/locale_spec.rb +60 -0
- data/spec/features/order_spec.rb +73 -0
- data/spec/features/products_spec.rb +260 -0
- data/spec/features/promotion_code_invalidation_spec.rb +51 -0
- data/spec/features/quantity_promotions_spec.rb +128 -0
- data/spec/features/taxons_spec.rb +135 -0
- data/spec/features/template_rendering_spec.rb +19 -0
- data/spec/fixtures/thinking-cat.jpg +0 -0
- data/spec/helpers/base_helper_spec.rb +11 -0
- data/spec/spec_helper.rb +121 -0
- data/spec/support/shared_contexts/checkout_setup.rb +9 -0
- data/spec/support/shared_contexts/custom_products.rb +25 -0
- data/spec/support/shared_contexts/product_prototypes.rb +30 -0
- data/spec/views/spree/checkout/_summary_spec.rb +11 -0
- metadata +47 -6
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Template rendering", :type => :feature do
|
4
|
+
|
5
|
+
after do
|
6
|
+
Capybara.ignore_hidden_elements = true
|
7
|
+
end
|
8
|
+
|
9
|
+
before do
|
10
|
+
Capybara.ignore_hidden_elements = false
|
11
|
+
end
|
12
|
+
|
13
|
+
it 'layout should have canonical tag referencing site url' do
|
14
|
+
Spree::Store.create!(code: 'spree', name: 'My Spree Store', url: 'spreestore.example.com', mail_from_address: 'test@example.com')
|
15
|
+
|
16
|
+
visit spree.root_path
|
17
|
+
expect(find('link[rel=canonical]')[:href]).to eql('http://spreestore.example.com/')
|
18
|
+
end
|
19
|
+
end
|
Binary file
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
describe BaseHelper, :type => :helper do
|
5
|
+
# Regression test for #2759
|
6
|
+
it "nested_taxons_path works with a Taxon object" do
|
7
|
+
taxon = create(:taxon, :name => "iphone")
|
8
|
+
expect(spree.nested_taxons_path(taxon)).to eq("/t/iphone")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
if ENV["COVERAGE"]
|
2
|
+
# Run Coverage report
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start do
|
5
|
+
add_group 'Controllers', 'app/controllers'
|
6
|
+
add_group 'Helpers', 'app/helpers'
|
7
|
+
add_group 'Mailers', 'app/mailers'
|
8
|
+
add_group 'Models', 'app/models'
|
9
|
+
add_group 'Views', 'app/views'
|
10
|
+
add_group 'Libraries', 'lib'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
15
|
+
# from the project root directory.
|
16
|
+
ENV["RAILS_ENV"] ||= 'test'
|
17
|
+
|
18
|
+
begin
|
19
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
20
|
+
rescue LoadError
|
21
|
+
$stderr.puts "Could not load dummy application. Please ensure you have run `bundle exec rake test_app`"
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
|
25
|
+
require 'rspec/rails'
|
26
|
+
require 'ffaker'
|
27
|
+
|
28
|
+
# Requires supporting files with custom matchers and macros, etc,
|
29
|
+
# in ./support/ and its subdirectories.
|
30
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
31
|
+
|
32
|
+
require 'database_cleaner'
|
33
|
+
|
34
|
+
if ENV["CHECK_TRANSLATIONS"]
|
35
|
+
require "spree/testing_support/i18n"
|
36
|
+
end
|
37
|
+
|
38
|
+
require 'spree/testing_support/authorization_helpers'
|
39
|
+
require 'spree/testing_support/capybara_ext'
|
40
|
+
require 'spree/testing_support/factories'
|
41
|
+
require 'spree/testing_support/preferences'
|
42
|
+
require 'spree/testing_support/controller_requests'
|
43
|
+
require 'spree/testing_support/flash'
|
44
|
+
require 'spree/testing_support/url_helpers'
|
45
|
+
require 'spree/testing_support/order_walkthrough'
|
46
|
+
require 'spree/testing_support/caching'
|
47
|
+
|
48
|
+
require 'paperclip/matchers'
|
49
|
+
|
50
|
+
if ENV['WEBDRIVER'] == 'accessible'
|
51
|
+
require 'capybara/accessible'
|
52
|
+
Capybara.javascript_driver = :accessible
|
53
|
+
else
|
54
|
+
require 'capybara/poltergeist'
|
55
|
+
Capybara.javascript_driver = :poltergeist
|
56
|
+
end
|
57
|
+
|
58
|
+
RSpec.configure do |config|
|
59
|
+
config.color = true
|
60
|
+
config.infer_spec_type_from_file_location!
|
61
|
+
config.mock_with :rspec
|
62
|
+
|
63
|
+
config.fixture_path = File.join(File.expand_path(File.dirname(__FILE__)), "fixtures")
|
64
|
+
|
65
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
66
|
+
# examples within a transaction, comment the following line or assign false
|
67
|
+
# instead of true.
|
68
|
+
config.use_transactional_fixtures = false
|
69
|
+
|
70
|
+
if ENV['WEBDRIVER'] == 'accessible'
|
71
|
+
config.around(:each, :inaccessible => true) do |example|
|
72
|
+
Capybara::Accessible.skip_audit { example.run }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
config.before(:suite) do
|
77
|
+
DatabaseCleaner.clean_with :truncation
|
78
|
+
end
|
79
|
+
|
80
|
+
config.before(:each) do
|
81
|
+
Rails.cache.clear
|
82
|
+
reset_spree_preferences
|
83
|
+
WebMock.disable!
|
84
|
+
if RSpec.current_example.metadata[:js]
|
85
|
+
DatabaseCleaner.strategy = :truncation
|
86
|
+
else
|
87
|
+
DatabaseCleaner.strategy = :transaction
|
88
|
+
end
|
89
|
+
DatabaseCleaner.start
|
90
|
+
end
|
91
|
+
|
92
|
+
config.after(:each) do
|
93
|
+
DatabaseCleaner.clean
|
94
|
+
end
|
95
|
+
|
96
|
+
config.after(:each, :type => :feature) do |example|
|
97
|
+
missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
|
98
|
+
if missing_translations.any?
|
99
|
+
puts "Found missing translations: #{missing_translations.inspect}"
|
100
|
+
puts "In spec: #{example.location}"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
config.include FactoryGirl::Syntax::Methods
|
106
|
+
|
107
|
+
config.include Spree::TestingSupport::Preferences
|
108
|
+
config.include Spree::TestingSupport::UrlHelpers
|
109
|
+
config.include Spree::TestingSupport::ControllerRequests, type: :controller
|
110
|
+
config.include Spree::TestingSupport::Flash
|
111
|
+
|
112
|
+
config.include Paperclip::Shoulda::Matchers
|
113
|
+
|
114
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
115
|
+
|
116
|
+
config.example_status_persistence_file_path = "./spec/examples.txt"
|
117
|
+
|
118
|
+
config.order = :random
|
119
|
+
|
120
|
+
Kernel.srand config.seed
|
121
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
shared_context 'checkout setup' do
|
2
|
+
let!(:country) { create(:country, states_required: true) }
|
3
|
+
let!(:state) { create(:state, country: country) }
|
4
|
+
let!(:shipping_method) { create(:shipping_method) }
|
5
|
+
let!(:stock_location) { create(:stock_location) }
|
6
|
+
let!(:mug) { create(:product, name: "RoR Mug") }
|
7
|
+
let!(:payment_method) { create(:check_payment_method) }
|
8
|
+
let!(:zone) { create(:zone) }
|
9
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
shared_context "custom products" do
|
2
|
+
before(:each) do
|
3
|
+
taxonomy = FactoryGirl.create(:taxonomy, :name => 'Categories')
|
4
|
+
root = taxonomy.root
|
5
|
+
clothing_taxon = FactoryGirl.create(:taxon, :name => 'Clothing', :parent_id => root.id)
|
6
|
+
bags_taxon = FactoryGirl.create(:taxon, :name => 'Bags', :parent_id => root.id)
|
7
|
+
mugs_taxon = FactoryGirl.create(:taxon, :name => 'Mugs', :parent_id => root.id)
|
8
|
+
|
9
|
+
taxonomy = FactoryGirl.create(:taxonomy, :name => 'Brands')
|
10
|
+
root = taxonomy.root
|
11
|
+
apache_taxon = FactoryGirl.create(:taxon, :name => 'Apache', :parent_id => root.id)
|
12
|
+
rails_taxon = FactoryGirl.create(:taxon, :name => 'Ruby on Rails', :parent_id => root.id)
|
13
|
+
ruby_taxon = FactoryGirl.create(:taxon, :name => 'Ruby', :parent_id => root.id)
|
14
|
+
|
15
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Ringer T-Shirt', :price => '19.99', :taxons => [rails_taxon, clothing_taxon])
|
16
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Mug', :price => '15.99', :taxons => [rails_taxon, mugs_taxon])
|
17
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Tote', :price => '15.99', :taxons => [rails_taxon, bags_taxon])
|
18
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Bag', :price => '22.99', :taxons => [rails_taxon, bags_taxon])
|
19
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Baseball Jersey', :price => '19.99', :taxons => [rails_taxon, clothing_taxon])
|
20
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Stein', :price => '16.99', :taxons => [rails_taxon, mugs_taxon])
|
21
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby on Rails Jr. Spaghetti', :price => '19.99', :taxons => [rails_taxon, clothing_taxon])
|
22
|
+
FactoryGirl.create(:custom_product, :name => 'Ruby Baseball Jersey', :price => '19.99', :taxons => [ruby_taxon, clothing_taxon])
|
23
|
+
FactoryGirl.create(:custom_product, :name => 'Apache Baseball Jersey', :price => '19.99', :taxons => [apache_taxon, clothing_taxon])
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
shared_context "product prototype" do
|
2
|
+
|
3
|
+
def build_option_type_with_values(name, values)
|
4
|
+
ot = FactoryGirl.create(:option_type, :name => name)
|
5
|
+
values.each do |val|
|
6
|
+
ot.option_values.create(:name => val.downcase, :presentation => val)
|
7
|
+
end
|
8
|
+
ot
|
9
|
+
end
|
10
|
+
|
11
|
+
let(:product_attributes) do
|
12
|
+
# FactoryGirl.attributes_for is un-deprecated!
|
13
|
+
# https://github.com/thoughtbot/factory_girl/issues/274#issuecomment-3592054
|
14
|
+
FactoryGirl.attributes_for(:base_product)
|
15
|
+
end
|
16
|
+
|
17
|
+
let(:prototype) do
|
18
|
+
size = build_option_type_with_values("size", %w(Small Medium Large))
|
19
|
+
FactoryGirl.create(:prototype, :name => "Size", :option_types => [ size ])
|
20
|
+
end
|
21
|
+
|
22
|
+
let(:option_values_hash) do
|
23
|
+
hash = {}
|
24
|
+
prototype.option_types.each do |i|
|
25
|
+
hash[i.id.to_s] = i.option_value_ids
|
26
|
+
end
|
27
|
+
hash
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "spree/checkout/_summary.html.erb", :type => :view do
|
4
|
+
# Regression spec for #4223
|
5
|
+
it "does not use the @order instance variable" do
|
6
|
+
order = stub_model(Spree::Order)
|
7
|
+
expect do
|
8
|
+
render :partial => "spree/checkout/summary", :locals => {:order => order}
|
9
|
+
end.not_to raise_error
|
10
|
+
end
|
11
|
+
end
|
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.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-23 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.0.3
|
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.0.3
|
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.0.3
|
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.0.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: canonical-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,8 +86,11 @@ executables: []
|
|
86
86
|
extensions: []
|
87
87
|
extra_rdoc_files: []
|
88
88
|
files:
|
89
|
+
- CHANGELOG.md
|
90
|
+
- Gemfile
|
89
91
|
- LICENSE
|
90
92
|
- README.md
|
93
|
+
- Rakefile
|
91
94
|
- app/assets/images/credit_cards/amex_cid.gif
|
92
95
|
- app/assets/images/credit_cards/credit_card.gif
|
93
96
|
- app/assets/images/credit_cards/discover_cid.gif
|
@@ -194,6 +197,44 @@ files:
|
|
194
197
|
- lib/spree_frontend.rb
|
195
198
|
- lib/tasks/rake_util.rb
|
196
199
|
- lib/tasks/taxon.rake
|
200
|
+
- script/rails
|
201
|
+
- solidus_frontend.gemspec
|
202
|
+
- spec/controllers/controller_extension_spec.rb
|
203
|
+
- spec/controllers/controller_helpers_spec.rb
|
204
|
+
- spec/controllers/spree/checkout_controller_spec.rb
|
205
|
+
- spec/controllers/spree/checkout_controller_with_views_spec.rb
|
206
|
+
- spec/controllers/spree/content_controller_spec.rb
|
207
|
+
- spec/controllers/spree/current_order_tracking_spec.rb
|
208
|
+
- spec/controllers/spree/home_controller_spec.rb
|
209
|
+
- spec/controllers/spree/orders_controller_ability_spec.rb
|
210
|
+
- spec/controllers/spree/orders_controller_spec.rb
|
211
|
+
- spec/controllers/spree/orders_controller_transitions_spec.rb
|
212
|
+
- spec/controllers/spree/products_controller_spec.rb
|
213
|
+
- spec/controllers/spree/taxons_controller_spec.rb
|
214
|
+
- spec/features/address_spec.rb
|
215
|
+
- spec/features/automatic_promotion_adjustments_spec.rb
|
216
|
+
- spec/features/caching/products_spec.rb
|
217
|
+
- spec/features/caching/taxons_spec.rb
|
218
|
+
- spec/features/cart_spec.rb
|
219
|
+
- spec/features/checkout_spec.rb
|
220
|
+
- spec/features/checkout_unshippable_spec.rb
|
221
|
+
- spec/features/coupon_code_spec.rb
|
222
|
+
- spec/features/currency_spec.rb
|
223
|
+
- spec/features/free_shipping_promotions_spec.rb
|
224
|
+
- spec/features/locale_spec.rb
|
225
|
+
- spec/features/order_spec.rb
|
226
|
+
- spec/features/products_spec.rb
|
227
|
+
- spec/features/promotion_code_invalidation_spec.rb
|
228
|
+
- spec/features/quantity_promotions_spec.rb
|
229
|
+
- spec/features/taxons_spec.rb
|
230
|
+
- spec/features/template_rendering_spec.rb
|
231
|
+
- spec/fixtures/thinking-cat.jpg
|
232
|
+
- spec/helpers/base_helper_spec.rb
|
233
|
+
- spec/spec_helper.rb
|
234
|
+
- spec/support/shared_contexts/checkout_setup.rb
|
235
|
+
- spec/support/shared_contexts/custom_products.rb
|
236
|
+
- spec/support/shared_contexts/product_prototypes.rb
|
237
|
+
- spec/views/spree/checkout/_summary_spec.rb
|
197
238
|
- vendor/assets/images/datepicker/cal.gif
|
198
239
|
- vendor/assets/images/flags/ad.png
|
199
240
|
- vendor/assets/images/flags/ae.png
|