solidus_frontend 1.2.3 → 1.3.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of solidus_frontend might be problematic. Click here for more details.

Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -3
  3. data/Rakefile +1 -1
  4. data/app/assets/javascripts/spree/frontend/checkout/address.js.coffee +0 -2
  5. data/app/assets/stylesheets/spree/frontend.css +1 -2
  6. data/app/assets/stylesheets/spree/frontend/_skeleton.scss +242 -0
  7. data/app/assets/stylesheets/spree/frontend/screen.css.scss +1 -0
  8. data/app/controllers/spree/checkout_controller.rb +93 -93
  9. data/app/controllers/spree/content_controller.rb +1 -1
  10. data/app/controllers/spree/orders_controller.rb +15 -16
  11. data/app/controllers/spree/products_controller.rb +19 -18
  12. data/app/controllers/spree/store_controller.rb +27 -27
  13. data/app/controllers/spree/taxons_controller.rb +1 -2
  14. data/app/models/spree/frontend_configuration.rb +1 -1
  15. data/app/views/spree/address/_form.html.erb +18 -12
  16. data/app/views/spree/orders/show.html.erb +2 -2
  17. data/app/views/spree/products/_cart_form.html.erb +5 -5
  18. data/app/views/spree/products/show.html.erb +1 -1
  19. data/app/views/spree/shared/_google_analytics.html.erb +1 -1
  20. data/app/views/spree/shared/_order_details.html.erb +12 -11
  21. data/app/views/spree/shared/_products.html.erb +2 -2
  22. data/config/initializers/assets.rb +8 -1
  23. data/config/initializers/canonical_rails.rb +1 -2
  24. data/config/routes.rb +17 -18
  25. data/lib/spree/frontend.rb +1 -0
  26. data/lib/spree/frontend/engine.rb +1 -9
  27. data/lib/spree/frontend/middleware/seo_assist.rb +3 -4
  28. data/lib/tasks/rake_util.rb +3 -6
  29. data/lib/tasks/taxon.rake +3 -3
  30. data/script/rails +0 -1
  31. data/solidus_frontend.gemspec +1 -0
  32. data/spec/controllers/controller_extension_spec.rb +15 -15
  33. data/spec/controllers/controller_helpers_spec.rb +1 -2
  34. data/spec/controllers/spree/checkout_controller_spec.rb +67 -115
  35. data/spec/controllers/spree/content_controller_spec.rb +1 -1
  36. data/spec/controllers/spree/current_order_tracking_spec.rb +7 -6
  37. data/spec/controllers/spree/home_controller_spec.rb +3 -3
  38. data/spec/controllers/spree/orders_controller_ability_spec.rb +17 -16
  39. data/spec/controllers/spree/orders_controller_spec.rb +9 -8
  40. data/spec/controllers/spree/orders_controller_transitions_spec.rb +5 -5
  41. data/spec/controllers/spree/products_controller_spec.rb +10 -11
  42. data/spec/controllers/spree/taxons_controller_spec.rb +5 -5
  43. data/spec/features/address_spec.rb +15 -15
  44. data/spec/features/automatic_promotion_adjustments_spec.rb +18 -18
  45. data/spec/features/caching/products_spec.rb +2 -2
  46. data/spec/features/caching/taxons_spec.rb +2 -2
  47. data/spec/features/cart_spec.rb +8 -6
  48. data/spec/features/checkout_spec.rb +49 -51
  49. data/spec/features/checkout_unshippable_spec.rb +4 -5
  50. data/spec/features/coupon_code_spec.rb +28 -30
  51. data/spec/features/currency_spec.rb +3 -3
  52. data/spec/features/free_shipping_promotions_spec.rb +17 -17
  53. data/spec/features/locale_spec.rb +33 -24
  54. data/spec/features/order_spec.rb +4 -4
  55. data/spec/features/products_spec.rb +12 -12
  56. data/spec/features/promotion_code_invalidation_spec.rb +1 -0
  57. data/spec/features/quantity_promotions_spec.rb +1 -1
  58. data/spec/features/taxons_spec.rb +16 -16
  59. data/spec/features/template_rendering_spec.rb +1 -2
  60. data/spec/helpers/base_helper_spec.rb +2 -2
  61. data/spec/spec_helper.rb +5 -5
  62. data/spec/support/shared_contexts/checkout_setup.rb +1 -0
  63. data/spec/support/shared_contexts/custom_products.rb +18 -17
  64. data/spec/support/shared_contexts/product_prototypes.rb +3 -5
  65. data/spec/views/spree/checkout/_summary_spec.rb +2 -2
  66. metadata +24 -9
@@ -1,8 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Switching currencies in backend", :type => :feature do
3
+ describe "Switching currencies in backend", type: :feature do
4
4
  before do
5
- create(:base_product, :name => "RoR Mug")
5
+ create(:store)
6
+ create(:base_product, name: "RoR Mug")
6
7
  end
7
8
 
8
9
  # Regression test for https://github.com/spree/spree/issues/2340
@@ -14,5 +15,4 @@ describe "Switching currencies in backend", :type => :feature do
14
15
  Spree::Config[:currency] = "AUD"
15
16
  visit spree.root_path
16
17
  end
17
-
18
18
  end
@@ -1,8 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Free shipping promotions", :type => :feature, :js => true do
4
- let!(:country) { create(:country, :name => "United States of America", :states_required => true) }
5
- let!(:state) { create(:state, :name => "Alabama", :country => country) }
3
+ describe "Free shipping promotions", type: :feature, js: true do
4
+ let!(:store) { create(:store) }
5
+ let!(:country) { create(:country, name: "United States of America", states_required: true) }
6
+ let!(:state) { create(:state, name: "Alabama", country: country) }
6
7
  let!(:zone) { create(:zone) }
7
8
  let!(:shipping_method) do
8
9
  sm = create(:shipping_method)
@@ -12,11 +13,11 @@ describe "Free shipping promotions", :type => :feature, :js => true do
12
13
  end
13
14
 
14
15
  let!(:payment_method) { create(:check_payment_method) }
15
- let!(:product) { create(:product, :name => "RoR Mug", :price => 20) }
16
+ let!(:product) { create(:product, name: "RoR Mug", price: 20) }
16
17
  let!(:promotion) do
17
- promotion = Spree::Promotion.create!(:name => "Free Shipping",
18
- :starts_at => 1.day.ago,
19
- :expires_at => 1.day.from_now)
18
+ promotion = Spree::Promotion.create!(name: "Free Shipping",
19
+ starts_at: 1.day.ago,
20
+ expires_at: 1.day.from_now)
20
21
 
21
22
  action = Spree::Promotion::Actions::FreeShipping.new
22
23
  action.promotion = promotion
@@ -27,20 +28,19 @@ describe "Free shipping promotions", :type => :feature, :js => true do
27
28
 
28
29
  context "free shipping promotion automatically applied" do
29
30
  before do
30
-
31
31
  visit spree.root_path
32
32
  click_link "RoR Mug"
33
33
  click_button "add-to-cart-button"
34
34
  click_button "Checkout"
35
- fill_in "order_email", :with => "spree@example.com"
36
- fill_in "First Name", :with => "John"
37
- fill_in "Last Name", :with => "Smith"
38
- fill_in "Street Address", :with => "1 John Street"
39
- fill_in "City", :with => "City of John"
40
- fill_in "Zip", :with => "01337"
41
- select country.name, :from => "Country"
42
- select state.name, :from => "order[bill_address_attributes][state_id]"
43
- fill_in "Phone", :with => "555-555-5555"
35
+ fill_in "order_email", with: "spree@example.com"
36
+ fill_in "First Name", with: "John"
37
+ fill_in "Last Name", with: "Smith"
38
+ fill_in "Street Address", with: "1 John Street"
39
+ fill_in "City", with: "City of John"
40
+ fill_in "Zip", with: "01337"
41
+ select country.name, from: "Country"
42
+ select state.name, from: "order[bill_address_attributes][state_id]"
43
+ fill_in "Phone", with: "555-555-5555"
44
44
 
45
45
  # To shipping method screen
46
46
  click_button "Save and Continue"
@@ -1,10 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'setting locale', :type => :feature do
3
+ describe 'setting locale', type: :feature do
4
+ let!(:store) { create(:store) }
4
5
  def with_locale(locale)
5
6
  I18n.locale = locale
6
7
  Spree::Frontend::Config[:locale] = locale
7
8
  yield
9
+ ensure
8
10
  I18n.locale = I18n.default_locale
9
11
  Spree::Frontend::Config[:locale] = 'en'
10
12
  end
@@ -12,9 +14,9 @@ describe 'setting locale', :type => :feature do
12
14
  context 'shopping cart link and page' do
13
15
  before do
14
16
  I18n.backend.store_translations(:fr,
15
- :spree => {
16
- :cart => 'Panier',
17
- :shopping_cart => 'Panier'
17
+ spree: {
18
+ cart: 'Panier',
19
+ shopping_cart: 'Panier'
18
20
  })
19
21
  end
20
22
 
@@ -27,34 +29,41 @@ describe 'setting locale', :type => :feature do
27
29
  end
28
30
  end
29
31
 
30
- context 'checkout form validation messages' do
32
+ shared_examples "localized error message" do
31
33
  include_context 'checkout setup'
32
34
 
33
- let(:error_messages) do
34
- {
35
- 'en' => 'This field is required.',
36
- 'fr' => 'Ce champ est obligatoire.',
37
- 'de' => 'Dieses Feld ist ein Pflichtfeld.',
38
- }
39
- end
40
-
41
- def check_error_text(text)
42
- %w(firstname lastname address1 city).each do |attr|
43
- expect(find(".field#b#{attr} label.error").text).to eq(text)
44
- end
45
- end
46
-
47
35
  it 'shows translated jquery.validate error messages', js: true do
48
36
  visit spree.root_path
49
37
  click_link mug.name
50
38
  click_button 'add-to-cart-button'
51
- error_messages.each do |locale, message|
52
- with_locale(locale) do
53
- visit '/checkout/address'
54
- find('.form-buttons input[type=submit]').click
55
- check_error_text message
39
+ with_locale(locale) do
40
+ visit '/checkout/address'
41
+ find('.form-buttons input[type=submit]').click
42
+
43
+ %w(firstname lastname address1 city).each do |attr|
44
+ expect(find(".field#b#{attr} label.error")).to have_text(message)
56
45
  end
57
46
  end
58
47
  end
59
48
  end
49
+
50
+ context 'checkout form validation messages' do
51
+ context 'en' do
52
+ let(:locale) { 'en' }
53
+ let(:message) { 'This field is required.' }
54
+ it_behaves_like "localized error message"
55
+ end
56
+
57
+ context 'fr' do
58
+ let(:locale) { 'fr' }
59
+ let(:message) { 'Ce champ est obligatoire.' }
60
+ it_behaves_like "localized error message"
61
+ end
62
+
63
+ context 'de' do
64
+ let(:locale) { 'de' }
65
+ let(:message) { 'Dieses Feld ist ein Pflichtfeld.' }
66
+ it_behaves_like "localized error message"
67
+ end
68
+ end
60
69
  end
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe 'orders', :type => :feature do
3
+ describe 'orders', type: :feature do
4
4
  let(:order) { OrderWalkthrough.up_to(:complete) }
5
5
  let(:user) { create(:user) }
6
6
 
7
7
  before do
8
8
  order.update_attribute(:user_id, user.id)
9
- allow_any_instance_of(Spree::OrdersController).to receive_messages(:try_spree_current_user => user)
9
+ allow_any_instance_of(Spree::OrdersController).to receive_messages(try_spree_current_user: user)
10
10
  end
11
11
 
12
12
  it "can visit an order" do
@@ -30,7 +30,7 @@ describe 'orders', :type => :feature do
30
30
  end
31
31
 
32
32
  it "should have credit card info if paid with credit card" do
33
- create(:payment, :order => order)
33
+ create(:payment, order: order)
34
34
  visit spree.order_path(order)
35
35
  within '.payment-info' do
36
36
  expect(page).to have_content "Ending in 1111"
@@ -38,7 +38,7 @@ describe 'orders', :type => :feature do
38
38
  end
39
39
 
40
40
  it "should have payment method name visible if not paid with credit card" do
41
- create(:check_payment, :order => order)
41
+ create(:check_payment, order: order)
42
42
  visit spree.order_path(order)
43
43
  within '.payment-info' do
44
44
  expect(page).to have_content "Check"
@@ -22,7 +22,7 @@ describe "Visiting Products", type: :feature, inaccessible: true do
22
22
 
23
23
  describe 'meta tags and title' do
24
24
  let(:jersey) { Spree::Product.find_by_name('Ruby on Rails Baseball Jersey') }
25
- let(:metas) { { :meta_description => 'Brand new Ruby on Rails Jersey', :meta_title => 'Ruby on Rails Baseball Jersey Buy High Quality Geek Apparel', :meta_keywords => 'ror, jersey, ruby' } }
25
+ let(:metas) { { meta_description: 'Brand new Ruby on Rails Jersey', meta_title: 'Ruby on Rails Baseball Jersey Buy High Quality Geek Apparel', meta_keywords: 'ror, jersey, ruby' } }
26
26
 
27
27
  it 'should return the correct title when displaying a single product' do
28
28
  click_link jersey.name
@@ -66,6 +66,7 @@ describe "Visiting Products", type: :feature, inaccessible: true do
66
66
  context "using Russian Rubles as a currency" do
67
67
  before do
68
68
  Spree::Config[:currency] = "RUB"
69
+ Spree::Config.remove_instance_variable(:@default_pricing_options)
69
70
  end
70
71
 
71
72
  let!(:product) do
@@ -92,7 +93,7 @@ describe "Visiting Products", type: :feature, inaccessible: true do
92
93
  end
93
94
  end
94
95
 
95
- it "when adding a product to the cart", :js => true do
96
+ it "when adding a product to the cart", js: true do
96
97
  visit spree.product_path(product)
97
98
  click_button "Add To Cart"
98
99
  click_link "Home"
@@ -113,7 +114,7 @@ describe "Visiting Products", type: :feature, inaccessible: true do
113
114
  end
114
115
 
115
116
  it "should be able to search for a product" do
116
- fill_in "keywords", :with => "shirt"
117
+ fill_in "keywords", with: "shirt"
117
118
  click_button "Search"
118
119
 
119
120
  expect(page.all('ul.product-listing li').size).to eq(1)
@@ -122,13 +123,13 @@ describe "Visiting Products", type: :feature, inaccessible: true do
122
123
  context "a product with variants" do
123
124
  let(:product) { Spree::Product.find_by_name("Ruby on Rails Baseball Jersey") }
124
125
  let(:option_value) { create(:option_value) }
125
- let!(:variant) { product.variants.create!(:price => 5.59) }
126
+ let!(:variant) { product.variants.create!(price: 5.59) }
126
127
 
127
128
  before do
128
129
  # Need to have two images to trigger the error
129
130
  image = File.open(File.expand_path('../../fixtures/thinking-cat.jpg', __FILE__))
130
- product.images.create!(:attachment => image)
131
- product.images.create!(:attachment => image)
131
+ product.images.create!(attachment: image)
132
+ product.images.create!(attachment: image)
132
133
 
133
134
  product.option_types << option_value.option_type
134
135
  variant.option_values << option_value
@@ -177,7 +178,6 @@ describe "Visiting Products", type: :feature, inaccessible: true do
177
178
  expect(page.all('ul.product-listing li').size).to eq(0)
178
179
  end
179
180
 
180
-
181
181
  it "should be able to display products priced under 10 dollars" do
182
182
  within(:css, '#taxonomies') { click_link "Ruby on Rails" }
183
183
  check "Price_Range_Under_$10.00"
@@ -221,13 +221,13 @@ describe "Visiting Products", type: :feature, inaccessible: true do
221
221
  tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
222
222
  tmp.delete("")
223
223
  expect(tmp.sort!).to eq(["Ruby on Rails Bag",
224
- "Ruby on Rails Baseball Jersey",
225
- "Ruby on Rails Jr. Spaghetti",
226
- "Ruby on Rails Ringer T-Shirt"])
224
+ "Ruby on Rails Baseball Jersey",
225
+ "Ruby on Rails Jr. Spaghetti",
226
+ "Ruby on Rails Ringer T-Shirt"])
227
227
  end
228
228
 
229
229
  it "should be able to put a product without a description in the cart" do
230
- product = FactoryGirl.create(:base_product, :description => nil, :name => 'Sample', :price => '19.99')
230
+ product = FactoryGirl.create(:base_product, description: nil, name: 'Sample', price: '19.99')
231
231
  visit spree.product_path(product)
232
232
  expect(page).to have_content "This product has no description"
233
233
  click_button 'add-to-cart-button'
@@ -235,7 +235,7 @@ describe "Visiting Products", type: :feature, inaccessible: true do
235
235
  end
236
236
 
237
237
  it "shouldn't be able to put a product without a current price in the cart" do
238
- product = FactoryGirl.create(:base_product, :description => nil, :name => 'Sample', :price => '19.99')
238
+ product = FactoryGirl.create(:base_product, description: nil, name: 'Sample', price: '19.99')
239
239
  Spree::Config.currency = "CAN"
240
240
  Spree::Config.show_products_without_price = true
241
241
  visit spree.product_path(product)
@@ -11,6 +11,7 @@ RSpec.feature "Promotion Code Invalidation" do
11
11
  end
12
12
 
13
13
  background do
14
+ create(:store)
14
15
  FactoryGirl.create(:product, name: "DL-44")
15
16
  FactoryGirl.create(:product, name: "E-11")
16
17
 
@@ -12,6 +12,7 @@ RSpec.feature "Quantity Promotions" do
12
12
  given(:calculator) { FactoryGirl.create(:calculator, preferred_amount: 5) }
13
13
 
14
14
  background do
15
+ create(:store)
15
16
  FactoryGirl.create(:product, name: "DL-44")
16
17
  FactoryGirl.create(:product, name: "E-11")
17
18
  promotion.actions << action
@@ -125,4 +126,3 @@ RSpec.feature "Quantity Promotions" do
125
126
  end
126
127
  end
127
128
  end
128
-
@@ -1,15 +1,15 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe "viewing products", type: :feature, inaccessible: true do
4
- let!(:taxonomy) { create(:taxonomy, :name => "Category") }
5
- let!(:super_clothing) { taxonomy.root.children.create(:name => "Super Clothing") }
6
- let!(:t_shirts) { super_clothing.children.create(:name => "T-Shirts") }
7
- let!(:xxl) { t_shirts.children.create(:name => "XXL") }
4
+ let!(:taxonomy) { create(:taxonomy, name: "Category") }
5
+ let!(:super_clothing) { taxonomy.root.children.create(name: "Super Clothing") }
6
+ let!(:t_shirts) { super_clothing.children.create(name: "T-Shirts") }
7
+ let!(:xxl) { t_shirts.children.create(name: "XXL") }
8
8
  let!(:product) do
9
- product = create(:product, :name => "Superman T-Shirt")
9
+ product = create(:product, name: "Superman T-Shirt")
10
10
  product.taxons << t_shirts
11
11
  end
12
- let(:metas) { { :meta_description => 'Brand new Ruby on Rails TShirts', :meta_title => "Ruby On Rails TShirt", :meta_keywords => 'ror, tshirt, ruby' } }
12
+ let(:metas) { { meta_description: 'Brand new Ruby on Rails TShirts', meta_title: "Ruby On Rails TShirt", meta_keywords: 'ror, tshirt, ruby' } }
13
13
  let(:store_name) do
14
14
  ((first_store = Spree::Store.first) && first_store.name).to_s
15
15
  end
@@ -74,12 +74,12 @@ describe "viewing products", type: :feature, inaccessible: true do
74
74
  tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
75
75
  tmp.delete("")
76
76
  array = ["Ruby on Rails Bag",
77
- "Ruby on Rails Baseball Jersey",
78
- "Ruby on Rails Jr. Spaghetti",
79
- "Ruby on Rails Mug",
80
- "Ruby on Rails Ringer T-Shirt",
81
- "Ruby on Rails Stein",
82
- "Ruby on Rails Tote"]
77
+ "Ruby on Rails Baseball Jersey",
78
+ "Ruby on Rails Jr. Spaghetti",
79
+ "Ruby on Rails Mug",
80
+ "Ruby on Rails Ringer T-Shirt",
81
+ "Ruby on Rails Stein",
82
+ "Ruby on Rails Tote"]
83
83
  expect(tmp.sort!).to eq(array)
84
84
  end
85
85
 
@@ -108,10 +108,10 @@ describe "viewing products", type: :feature, inaccessible: true do
108
108
  tmp = page.all('ul.product-listing li a').map(&:text).flatten.compact
109
109
  tmp.delete("")
110
110
  expect(tmp.sort!).to eq(["Apache Baseball Jersey",
111
- "Ruby Baseball Jersey",
112
- "Ruby on Rails Baseball Jersey",
113
- "Ruby on Rails Jr. Spaghetti",
114
- "Ruby on Rails Ringer T-Shirt"])
111
+ "Ruby Baseball Jersey",
112
+ "Ruby on Rails Baseball Jersey",
113
+ "Ruby on Rails Jr. Spaghetti",
114
+ "Ruby on Rails Ringer T-Shirt"])
115
115
  end
116
116
 
117
117
  it "should be able to visit category Mugs" do
@@ -1,7 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Template rendering", :type => :feature do
4
-
3
+ describe "Template rendering", type: :feature do
5
4
  after do
6
5
  Capybara.ignore_hidden_elements = true
7
6
  end
@@ -1,10 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Spree
4
- describe BaseHelper, :type => :helper do
4
+ describe BaseHelper, type: :helper do
5
5
  # Regression test for https://github.com/spree/spree/issues/2759
6
6
  it "nested_taxons_path works with a Taxon object" do
7
- taxon = create(:taxon, :name => "iphone")
7
+ taxon = create(:taxon, name: "iphone")
8
8
  expect(spree.nested_taxons_path(taxon)).to eq("/t/iphone")
9
9
  end
10
10
  end
data/spec/spec_helper.rb CHANGED
@@ -27,7 +27,7 @@ require 'ffaker'
27
27
 
28
28
  # Requires supporting files with custom matchers and macros, etc,
29
29
  # in ./support/ and its subdirectories.
30
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
30
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
31
31
 
32
32
  require 'database_cleaner'
33
33
 
@@ -58,6 +58,8 @@ else
58
58
  Capybara.javascript_driver = :poltergeist
59
59
  end
60
60
 
61
+ Capybara.default_max_wait_time = ENV['DEFAULT_MAX_WAIT_TIME'].to_f if ENV['DEFAULT_MAX_WAIT_TIME'].present?
62
+
61
63
  RSpec.configure do |config|
62
64
  config.color = true
63
65
  config.infer_spec_type_from_file_location!
@@ -76,7 +78,7 @@ RSpec.configure do |config|
76
78
  config.use_transactional_fixtures = false
77
79
 
78
80
  if ENV['WEBDRIVER'] == 'accessible'
79
- config.around(:each, :inaccessible => true) do |example|
81
+ config.around(:each, inaccessible: true) do |example|
80
82
  Capybara::Accessible.skip_audit { example.run }
81
83
  end
82
84
  end
@@ -88,7 +90,6 @@ RSpec.configure do |config|
88
90
  config.before(:each) do
89
91
  Rails.cache.clear
90
92
  reset_spree_preferences
91
- WebMock.disable!
92
93
  if RSpec.current_example.metadata[:js]
93
94
  page.driver.browser.url_blacklist = ['http://fonts.googleapis.com']
94
95
  DatabaseCleaner.strategy = :truncation
@@ -102,7 +103,7 @@ RSpec.configure do |config|
102
103
  DatabaseCleaner.clean
103
104
  end
104
105
 
105
- config.after(:each, :type => :feature) do |example|
106
+ config.after(:each, type: :feature) do |example|
106
107
  missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
107
108
  if missing_translations.any?
108
109
  puts "Found missing translations: #{missing_translations.inspect}"
@@ -110,7 +111,6 @@ RSpec.configure do |config|
110
111
  end
111
112
  end
112
113
 
113
-
114
114
  config.include FactoryGirl::Syntax::Methods
115
115
 
116
116
  config.include Spree::TestingSupport::Preferences
@@ -1,4 +1,5 @@
1
1
  shared_context 'checkout setup' do
2
+ let!(:store) { create(:store) }
2
3
  let!(:country) { create(:country, states_required: true) }
3
4
  let!(:state) { create(:state, country: country) }
4
5
  let!(:shipping_method) { create(:shipping_method) }
@@ -1,25 +1,26 @@
1
1
  shared_context "custom products" do
2
2
  before(:each) do
3
- taxonomy = FactoryGirl.create(:taxonomy, :name => 'Categories')
3
+ create(:store)
4
+ taxonomy = FactoryGirl.create(:taxonomy, name: 'Categories')
4
5
  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)
6
+ clothing_taxon = FactoryGirl.create(:taxon, name: 'Clothing', parent_id: root.id)
7
+ bags_taxon = FactoryGirl.create(:taxon, name: 'Bags', parent_id: root.id)
8
+ mugs_taxon = FactoryGirl.create(:taxon, name: 'Mugs', parent_id: root.id)
8
9
 
9
- taxonomy = FactoryGirl.create(:taxonomy, :name => 'Brands')
10
+ taxonomy = FactoryGirl.create(:taxonomy, name: 'Brands')
10
11
  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)
12
+ apache_taxon = FactoryGirl.create(:taxon, name: 'Apache', parent_id: root.id)
13
+ rails_taxon = FactoryGirl.create(:taxon, name: 'Ruby on Rails', parent_id: root.id)
14
+ ruby_taxon = FactoryGirl.create(:taxon, name: 'Ruby', parent_id: root.id)
14
15
 
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])
16
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Ringer T-Shirt', price: '19.99', taxons: [rails_taxon, clothing_taxon])
17
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Mug', price: '15.99', taxons: [rails_taxon, mugs_taxon])
18
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Tote', price: '15.99', taxons: [rails_taxon, bags_taxon])
19
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Bag', price: '22.99', taxons: [rails_taxon, bags_taxon])
20
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Baseball Jersey', price: '19.99', taxons: [rails_taxon, clothing_taxon])
21
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Stein', price: '16.99', taxons: [rails_taxon, mugs_taxon])
22
+ FactoryGirl.create(:custom_product, name: 'Ruby on Rails Jr. Spaghetti', price: '19.99', taxons: [rails_taxon, clothing_taxon])
23
+ FactoryGirl.create(:custom_product, name: 'Ruby Baseball Jersey', price: '19.99', taxons: [ruby_taxon, clothing_taxon])
24
+ FactoryGirl.create(:custom_product, name: 'Apache Baseball Jersey', price: '19.99', taxons: [apache_taxon, clothing_taxon])
24
25
  end
25
26
  end