spree_backend 3.0.7 → 3.0.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d13f9d0f8ce88f502cc8ee55faa2af5fd98b3dc6
4
- data.tar.gz: 4236a33d9301e30a573c0bbbe704492c9e41de01
3
+ metadata.gz: daee84dd83e85e5df24b838139cc486a4b559d11
4
+ data.tar.gz: eaee4e2c015d15e30fa49c6afe25d250ac00adcb
5
5
  SHA512:
6
- metadata.gz: 50b5936d9b443716bfa26296c5a1b5e36c56d46300ebb0c7344f43afefe571f5d7d3601221e43eb0651674869463db774917b000b3d6906d82cb517be8e82475
7
- data.tar.gz: d3234fde967703238bcd74fbcf30d8e81a304ba50000c110ec63f7a5c9cbd89f38094f9af9e974814af8fc13903b9af3e44cc9c4f396e864515cfa61bb3a98e0
6
+ metadata.gz: 15433bc812566f215feea0e894bf1945e1004475368e731bc7d88197f35b93f413ad94199c9e1c3869f711668568945748df2e938e6465502d04a692b3efc281
7
+ data.tar.gz: 4a353f1a845a1641c9bd8fe81d3c1023285e6d8ace5314c83e8b4000f3c89e9a8d8ed93e5dec1dd2dd5eb002655f2885e4c05293ed027c7b58a27f2523dfc5f2
data/Rakefile CHANGED
@@ -1,26 +1,12 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
  require 'rake/testtask'
4
- require 'rake/packagetask'
5
- require 'rubygems/package_task'
6
4
  require 'rspec/core/rake_task'
7
5
  require 'spree/testing_support/common_rake'
8
6
 
9
- Bundler::GemHelper.install_tasks
10
7
  RSpec::Core::RakeTask.new
11
8
 
12
- spec = eval(File.read('spree_backend.gemspec'))
13
- Gem::PackageTask.new(spec) do |p|
14
- p.gem_spec = spec
15
- end
16
-
17
- desc "Release to gemcutter"
18
- task :release do
19
- version = File.read(File.expand_path("../../SPREE_VERSION", __FILE__)).strip
20
- cmd = "cd pkg && gem push spree_backend-#{version}.gem"; puts cmd; system cmd
21
- end
22
-
23
- task :default => :spec
9
+ task default: :spec
24
10
 
25
11
  desc "Generates a dummy app for testing"
26
12
  task :test_app do
@@ -2,7 +2,7 @@ module Spree
2
2
  module Admin
3
3
  class RootController < Spree::Admin::BaseController
4
4
 
5
- skip_before_filter :authorize_admin
5
+ skip_before_action :authorize_admin
6
6
 
7
7
  def index
8
8
  redirect_to admin_root_redirect_path
@@ -3,11 +3,14 @@ module Spree
3
3
  module BaseHelper
4
4
  def flash_alert flash
5
5
  if flash.present?
6
+ close_button = button_tag(class: 'close', 'data-dismiss' => 'alert', 'aria-label' => Spree.t(:close)) do
7
+ content_tag('span', '&times;'.html_safe, 'aria-hidden' => true)
8
+ end
6
9
  message = flash[:error] || flash[:notice] || flash[:success]
7
10
  flash_class = "danger" if flash[:error]
8
11
  flash_class = "info" if flash[:notice]
9
12
  flash_class = "success" if flash[:success]
10
- flash_div = content_tag(:div, message, class: "alert alert-#{flash_class} alert-auto-disappear")
13
+ flash_div = content_tag(:div, (close_button + message), class: "alert alert-#{flash_class} alert-auto-disappear")
11
14
  content_tag(:div, flash_div, class: 'col-md-12')
12
15
  end
13
16
  end
@@ -2,13 +2,11 @@
2
2
  <%= Spree.t(:editing_resource, resource: Spree::PaymentMethod.model_name.human) %> / <%= @payment_method.name %>
3
3
  <% end %>
4
4
 
5
- <%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @payment_method } %>
5
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment_method } %>
6
6
 
7
- <%= form_for @payment_method, :url => admin_payment_method_path(@payment_method) do |f| %>
7
+ <%= form_for @payment_method, url: admin_payment_method_path(@payment_method) do |f| %>
8
8
  <fieldset>
9
- <%= render :partial => 'form', :locals => { :f => f } %>
10
- <div data-hook="buttons" class="actions">
11
- <%= button Spree.t('actions.update'), 'save' %>
12
- </div>
9
+ <%= render partial: 'form', locals: { f: f } %>
10
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
13
11
  </fieldset>
14
12
  <% end %>
@@ -2,13 +2,11 @@
2
2
  <%= Spree.t(:new_payment_method) %>
3
3
  <% end %>
4
4
 
5
- <%= render :partial => 'spree/admin/shared/error_messages', :locals => { :target => @payment_method } %>
5
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @payment_method } %>
6
6
 
7
- <%= form_for @payment_method, :url => collection_url do |f| %>
7
+ <%= form_for @payment_method, url: collection_url do |f| %>
8
8
  <fieldset>
9
- <%= render :partial => 'form', :locals => { :f => f } %>
10
- <div data-hook="buttons" class="actions">
11
- <%= button Spree.t(:create), 'save' %>
12
- </div>
9
+ <%= render partial: 'form', locals: { f: f } %>
10
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
13
11
  </fieldset>
14
12
  <% end %>
@@ -4,9 +4,7 @@
4
4
 
5
5
  <%= form_for [:admin, @taxonomy] do |f| %>
6
6
  <fieldset>
7
- <%= render :partial => 'form', :locals => { :f => f } %>
8
- <div class="form-actions" data-hook="buttons">
9
- <%= button Spree.t(:create), 'save' %>
10
- </div>
7
+ <%= render partial: 'form', locals: { f: f } %>
8
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
11
9
  </fieldset>
12
10
  <% end %>
@@ -1 +1 @@
1
- Rails.application.config.assets.precompile += %w( jquery-ui/* )
1
+ Rails.application.config.assets.precompile += %w( jquery-ui/* admin/* credit_cards/credit_card.gif )
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "General Settings", type: :feature, js: true do
3
+ describe "General Settings", type: :feature do
4
4
  stub_authorization!
5
5
 
6
6
  before(:each) do
@@ -30,7 +30,7 @@ describe "General Settings", type: :feature, js: true do
30
30
  end
31
31
  end
32
32
 
33
- context "clearing the cache" do
33
+ context "clearing the cache", js: true do
34
34
  it "should clear the cache" do
35
35
  expect(page).to_not have_content(Spree.t(:clear_cache_ok))
36
36
  expect(page).to have_content(Spree.t(:clear_cache_warning))
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Roles", type: :feature, js: true do
3
+ describe "Roles", type: :feature do
4
4
  stub_authorization!
5
5
 
6
6
  before(:each) do
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Stock Locations", type: :feature, js: true do
3
+ describe "Stock Locations", type: :feature do
4
4
  stub_authorization!
5
5
 
6
6
  before(:each) do
@@ -18,7 +18,7 @@ describe "Stock Locations", type: :feature, js: true do
18
18
  expect(page).to have_content("London")
19
19
  end
20
20
 
21
- it "can delete an existing stock location" do
21
+ it "can delete an existing stock location", js: true do
22
22
  location = create(:stock_location)
23
23
  visit current_path
24
24
 
@@ -32,7 +32,7 @@ describe "Stock Locations", type: :feature, js: true do
32
32
  expect(page).to have_content("No Stock Locations found")
33
33
  end
34
34
 
35
- it "can update an existing stock location" do
35
+ it "can update an existing stock location", js: true do
36
36
  create(:stock_location)
37
37
  visit current_path
38
38
 
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Tax Categories", type: :feature, js: true do
3
+ describe "Tax Categories", type: :feature do
4
4
  stub_authorization!
5
5
 
6
6
  before(:each) do
@@ -43,7 +43,7 @@ describe "Tax Categories", type: :feature, js: true do
43
43
  end
44
44
 
45
45
  context "admin editing a tax category" do
46
- it "should be able to update an existing tax category" do
46
+ it "should be able to update an existing tax category", js: true do
47
47
  create(:tax_category)
48
48
  click_link "Tax Categories"
49
49
  within_row(1) { click_icon :edit }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Tax Rates", type: :feature, js: true do
3
+ describe "Tax Rates", type: :feature do
4
4
  stub_authorization!
5
5
 
6
6
  let!(:tax_rate) { create(:tax_rate, calculator: stub_model(Spree::Calculator)) }
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Zones", type: :feature, js: true do
3
+ describe "Zones", type: :feature do
4
4
  stub_authorization!
5
5
 
6
6
  before(:each) do
@@ -15,21 +15,6 @@ describe "Customer Details", type: :feature, js: true do
15
15
 
16
16
  let!(:user) { create(:user, email: 'foobar@example.com', ship_address: ship_address, bill_address: bill_address) }
17
17
 
18
- # "Intelligiently" wait on condition
19
- #
20
- # Much better than a random sleep "here and there"
21
- # it will not cause any delay in case the condition is fullfilled on first cycle.
22
- def wait_for_condition
23
- time = Capybara.default_max_wait_time
24
- step = 0.1
25
- while time > 0
26
- return if yield
27
- sleep(step)
28
- time -= 0.1
29
- end
30
- fail "Could not achieve condition within #{Capybara.default_max_wait_time} seconds."
31
- end
32
-
33
18
  # Value attribute is dynamically set via JS, so not observable via a CSS/XPath selector
34
19
  # As the browser might take time to make the values visible in the dom we need to
35
20
  # "intelligiently" wait for that event o prevent a race.
@@ -4,13 +4,12 @@ require 'spec_helper'
4
4
  describe "Order Details", type: :feature, js: true do
5
5
  let!(:stock_location) { create(:stock_location_with_items) }
6
6
  let!(:product) { create(:product, name: 'spree t-shirt', price: 20.00) }
7
- let!(:tote) { create(:product, name: "Tote", price: 15.00) }
8
7
  let(:order) { create(:order, state: 'complete', completed_at: "2011-02-01 12:36:15", number: "R100") }
9
8
  let(:state) { create(:state) }
10
9
  let!(:shipping_method) { create(:shipping_method, name: "Default") }
11
10
 
12
11
  before do
13
- order.shipments.create(stock_location_id: stock_location.id)
12
+ order.shipments.create!(stock_location_id: stock_location.id)
14
13
  order.contents.add(product.master, 2)
15
14
  end
16
15
 
@@ -120,7 +119,7 @@ describe "Order Details", type: :feature, js: true do
120
119
  expect(page).to have_content("Backdoor")
121
120
  end
122
121
 
123
- it "will show the variant sku" do
122
+ it "will show the variant sku", js: false do
124
123
  order = create(:completed_order_with_totals)
125
124
  visit spree.edit_admin_order_path(order)
126
125
  sku = order.line_items.first.variant.sku
@@ -128,51 +127,64 @@ describe "Order Details", type: :feature, js: true do
128
127
  end
129
128
 
130
129
  context "with special_instructions present" do
131
- let(:order) { create(:order, state: 'complete', completed_at: "2011-02-01 12:36:15", number: "R100", special_instructions: "Very special instructions here") }
132
- it "will show the special_instructions" do
130
+ before(:each) do
131
+ order.update_column(:special_instructions, "Very special instructions here")
132
+ end
133
+
134
+ it "will show the special_instructions", js: false do
133
135
  visit spree.edit_admin_order_path(order)
134
136
  expect(page).to have_content("Very special instructions here")
135
137
  end
136
138
  end
137
139
 
138
- context "variant doesn't track inventory" do
139
- before do
140
- tote.master.update_column :track_inventory, false
141
- # make sure there's no stock level for any item
142
- tote.master.stock_items.update_all count_on_hand: 0, backorderable: false
143
- end
140
+ context 'when not tracking inventory' do
141
+ let(:tote) { create(:product, name: "Tote", price: 15.00) }
144
142
 
145
- it "adds variant to order just fine" do
146
- select2_search tote.name, from: Spree.t(:name_or_sku)
147
- within("table.stock-levels") do
148
- fill_in "variant_quantity", with: 1
149
- click_icon :add
143
+ context "variant doesn't track inventory" do
144
+ before do
145
+ tote.master.update_column :track_inventory, false
146
+ # make sure there's no stock level for any item
147
+ tote.master.stock_items.update_all count_on_hand: 0, backorderable: false
150
148
  end
151
149
 
152
- within(".line-items") do
153
- expect(page).to have_content(tote.name)
154
- end
155
- end
156
- end
150
+ it "adds variant to order just fine" do
151
+ select2_search tote.name, from: Spree.t(:name_or_sku)
152
+ within("table.stock-levels") do
153
+ fill_in "variant_quantity", with: 1
154
+ click_icon :add
155
+ end
157
156
 
158
- context "site doesn't track inventory" do
159
- before do
160
- Spree::Config.set track_inventory_levels: false
161
- product.master.update_column(:track_inventory, true)
162
- product.master.stock_items.first.update_column(:backorderable, true)
163
- product.master.stock_items.first.update_column(:count_on_hand, 0)
157
+ wait_for_ajax
158
+
159
+ within(".line-items") do
160
+ expect(page).to have_content(tote.name)
161
+ end
162
+ end
164
163
  end
165
164
 
166
- it "adds variant to order just fine" do
167
- select2_search product.name, from: Spree.t(:name_or_sku)
168
- within("table.stock-levels") do
169
- fill_in "variant_quantity", with: 1
170
- click_icon :add
165
+ context "site doesn't track inventory" do
166
+ before do
167
+ Spree::Config[:track_inventory_levels] = false
168
+ tote.master.update_column(:track_inventory, true)
169
+ # make sure there's no stock level for any item
170
+ tote.master.stock_items.update_all count_on_hand: 0, backorderable: true
171
171
  end
172
172
 
173
- within(".line-items") do
174
- expect(page).to have_content(product.name)
173
+ it "adds variant to order just fine" do
174
+ select2_search tote.name, from: Spree.t(:name_or_sku)
175
+ within("table.stock-levels") do
176
+ fill_in "variant_quantity", with: 1
177
+ click_icon :add
178
+ end
179
+
180
+ wait_for_ajax
181
+
182
+ within(".line-items") do
183
+ expect(page).to have_content(tote.name)
184
+ end
175
185
  end
186
+
187
+ after { Spree::Config[:track_inventory_levels] = true }
176
188
  end
177
189
  end
178
190
 
@@ -301,7 +313,7 @@ describe "Order Details", type: :feature, js: true do
301
313
 
302
314
  context 'A shipment has shipped' do
303
315
 
304
- it 'should not show or let me back to the cart page, nor show the shipment edit buttons' do
316
+ it 'should not show or let me back to the cart page, nor show the shipment edit buttons', js: false do
305
317
  order = create(:order, state: 'payment')
306
318
  order.shipments.create!(stock_location_id: stock_location.id, state: 'shipped')
307
319
 
@@ -376,24 +388,54 @@ describe "Order Details", type: :feature, js: true do
376
388
  end
377
389
  end
378
390
 
379
- context "site doesn't track inventory" do
380
- before do
381
- Spree::Config.set track_inventory_levels: false
382
- product.master.update_column(:track_inventory, true)
383
- product.master.stock_items.first.update_column(:backorderable, true)
384
- product.master.stock_items.first.update_column(:count_on_hand, 0)
391
+ context 'when not tracking inventory' do
392
+ let(:tote) { create(:product, name: "Tote", price: 15.00) }
393
+
394
+ context "variant doesn't track inventory" do
395
+ before do
396
+ tote.master.update_column :track_inventory, false
397
+ # make sure there's no stock level for any item
398
+ tote.master.stock_items.update_all count_on_hand: 0, backorderable: false
399
+ end
400
+
401
+ it "adds variant to order just fine" do
402
+ select2_search tote.name, from: Spree.t(:name_or_sku)
403
+ within("table.stock-levels") do
404
+ fill_in "stock_item_quantity", with: 1
405
+ click_icon :add
406
+ end
407
+
408
+ wait_for_ajax
409
+
410
+ within("[data-hook=admin_order_form_fields]") do
411
+ expect(page).to have_content(tote.name)
412
+ end
413
+ end
385
414
  end
386
415
 
387
- it "adds variant to order just fine" do
388
- select2_search product.name, from: Spree.t(:name_or_sku)
389
- within("table.stock-levels") do
390
- fill_in "stock_item_quantity", with: 1
391
- click_icon :add
416
+ context "site doesn't track inventory" do
417
+ before do
418
+ Spree::Config[:track_inventory_levels] = false
419
+ tote.master.update_column(:track_inventory, true)
420
+ # make sure there's no stock level for any item
421
+ tote.master.stock_items.update_all count_on_hand: 0, backorderable: true
392
422
  end
393
423
 
394
- within(".stock-contents") do
395
- expect(page).to have_content(product.name)
424
+ it "adds variant to order just fine" do
425
+ select2_search tote.name, from: Spree.t(:name_or_sku)
426
+ within("table.stock-levels") do
427
+ fill_in "stock_item_quantity", with: 1
428
+ click_icon :add
429
+ end
430
+
431
+ wait_for_ajax
432
+
433
+ within("[data-hook=admin_order_form_fields]") do
434
+ expect(page).to have_content(tote.name)
435
+ end
396
436
  end
437
+
438
+ after { Spree::Config[:track_inventory_levels] = true }
397
439
  end
398
440
  end
399
441
 
@@ -568,7 +610,7 @@ describe "Order Details", type: :feature, js: true do
568
610
  and_return(Spree.user_class.new)
569
611
  end
570
612
 
571
- it 'should not display order tabs or edit buttons without ability' do
613
+ it 'should not display order tabs or edit buttons without ability', js: false do
572
614
  visit spree.edit_admin_order_path(order)
573
615
 
574
616
  # Order Form
@@ -62,7 +62,7 @@ describe 'Payments', type: :feature, js: true do
62
62
  end
63
63
  end
64
64
 
65
- it 'lists and create payments for an order', js: true do
65
+ it 'lists and create payments for an order' do
66
66
  within_row(1) do
67
67
  expect(column_text(3)).to eq('$150.00')
68
68
  expect(column_text(4)).to eq('Credit Card')
@@ -91,7 +91,7 @@ describe 'Payments', type: :feature, js: true do
91
91
  end
92
92
 
93
93
  # Regression test for #1269
94
- it 'cannot create a payment for an order with no payment methods' do
94
+ it 'cannot create a payment for an order with no payment methods', js: false do
95
95
  Spree::PaymentMethod.delete_all
96
96
  order.payments.delete_all
97
97
 
@@ -101,7 +101,7 @@ describe 'Payments', type: :feature, js: true do
101
101
  end
102
102
 
103
103
  %w[checkout pending].each do |state|
104
- context "payment is #{state.inspect}", js: true do
104
+ context "payment is #{state.inspect}" do
105
105
  let(:state) { state }
106
106
 
107
107
  it 'allows the amount to be edited by clicking on the edit button then saving' do
@@ -152,7 +152,7 @@ describe 'Payments', type: :feature, js: true do
152
152
  end
153
153
  end
154
154
 
155
- context 'payment is completed' do
155
+ context 'payment is completed', js: false do
156
156
  let(:state) { 'completed' }
157
157
 
158
158
  it 'does not allow the amount to be edited' do
@@ -204,7 +204,7 @@ describe 'Payments', type: :feature, js: true do
204
204
 
205
205
  before { visit spree.admin_order_payments_path(order) }
206
206
 
207
- it "is able to reuse customer payment source" do
207
+ it "is able to reuse customer payment source", js: false do
208
208
  expect(find("#card_#{cc.id}")).to be_checked
209
209
  click_button "Continue"
210
210
  expect(page).to have_content("Payment has been successfully created!")
@@ -40,7 +40,7 @@ describe "Product Images", type: :feature, js: true do
40
40
  end
41
41
 
42
42
  # Regression test for #2228
43
- it "should see variant images" do
43
+ it "should see variant images", js: false do
44
44
  variant = create(:variant)
45
45
  variant.images.create!(attachment: File.open(file_path))
46
46
  visit spree.admin_product_images_path(variant.product)
@@ -64,7 +64,7 @@ describe "Product Images", type: :feature, js: true do
64
64
  end
65
65
  end
66
66
 
67
- it "should not see variant column when product has no variants" do
67
+ it "should not see variant column when product has no variants", js: false do
68
68
  product = create(:product)
69
69
  product.images.create!(attachment: File.open(file_path))
70
70
  visit spree.admin_product_images_path(product)
@@ -42,7 +42,7 @@ describe "Properties", type: :feature, js: true do
42
42
  end
43
43
 
44
44
  context "creating a property" do
45
- it "should allow an admin to create a new product property", js: true do
45
+ it "should allow an admin to create a new product property" do
46
46
  click_link "Products"
47
47
  click_link "Properties"
48
48
  click_link "new_property_link"
@@ -126,9 +126,10 @@ describe "Properties", type: :feature, js: true do
126
126
  end
127
127
 
128
128
  def delete_product_property
129
- page.evaluate_script('window.confirm = function() { return true; }')
130
- click_icon :delete
131
- wait_for_ajax # delete action must finish before reloading
129
+ accept_alert do
130
+ click_icon :delete
131
+ wait_for_ajax # delete action must finish before reloading
132
+ end
132
133
  end
133
134
 
134
135
  def check_property_row_count(expected_row_count)
@@ -93,7 +93,7 @@ describe "Prototypes", type: :feature, js: true do
93
93
  end
94
94
  end
95
95
 
96
- it 'should be deletable', js: true do
96
+ it 'should be deletable' do
97
97
  shirt_prototype = create(:prototype, name: "Shirt", properties: [])
98
98
  shirt_prototype.taxons << create(:taxon)
99
99
 
@@ -105,8 +105,8 @@ describe "Prototypes", type: :feature, js: true do
105
105
  page.find('.delete-resource').click
106
106
  end
107
107
 
108
- page.evaluate_script('window.confirm = function() { return true; }')
109
-
110
- expect(page).to have_content("Prototype \"#{shirt_prototype.name}\" has been successfully removed!")
108
+ accept_alert do
109
+ expect(page).to have_content("Prototype \"#{shirt_prototype.name}\" has been successfully removed!")
110
+ end
111
111
  end
112
112
  end
@@ -22,7 +22,7 @@ describe "Stock Management", type: :feature, js: true do
22
22
  wait_for_ajax
23
23
  end
24
24
 
25
- it "persists the value when page reload", js: true do
25
+ it "persists the value when page reload" do
26
26
  visit current_path
27
27
  expect(backorderable).not_to be_checked
28
28
  end
@@ -37,7 +37,7 @@ describe "Stock Management", type: :feature, js: true do
37
37
  wait_for_ajax
38
38
  end
39
39
 
40
- it "persists the value when page reloaded", js: true do
40
+ it "persists the value when page reloaded" do
41
41
  visit current_path
42
42
  expect(track_inventory).not_to be_checked
43
43
  end
@@ -47,7 +47,7 @@ describe "Stock Management", type: :feature, js: true do
47
47
  # The regression was that unchecking the last checkbox caused a redirect
48
48
  # to happen. By ensuring that we're still on an /admin/products URL, we
49
49
  # assert that the redirect is *not* happening.
50
- it "can toggle backorderable for the second variant stock item", js: true do
50
+ it "can toggle backorderable for the second variant stock item" do
51
51
  new_location = create(:stock_location, name: "Another Location")
52
52
  visit current_url
53
53
 
@@ -58,7 +58,7 @@ describe "Stock Management", type: :feature, js: true do
58
58
  expect(page.current_url).to include("/admin/products")
59
59
  end
60
60
 
61
- it "can create a new stock movement", js: true do
61
+ it "can create a new stock movement" do
62
62
  fill_in "stock_movement_quantity", with: 5
63
63
  select2 "default", from: "Stock Location"
64
64
  click_button "Add Stock"
@@ -70,7 +70,7 @@ describe "Stock Management", type: :feature, js: true do
70
70
  end
71
71
  end
72
72
 
73
- it "can create a new negative stock movement", js: true do
73
+ it "can create a new negative stock movement" do
74
74
  fill_in "stock_movement_quantity", with: -5
75
75
  select2 "default", from: "Stock Location"
76
76
  click_button "Add Stock"
@@ -89,7 +89,7 @@ describe "Stock Management", type: :feature, js: true do
89
89
  visit current_url
90
90
  end
91
91
 
92
- it "can create a new stock movement for the specified variant", js: true do
92
+ it "can create a new stock movement for the specified variant" do
93
93
  fill_in "stock_movement_quantity", with: 10
94
94
  select2 "SPREEC", from: "Variant"
95
95
  click_button "Add Stock"
@@ -114,7 +114,7 @@ describe "Stock Management", type: :feature, js: true do
114
114
  visit spree.stock_admin_product_path(@product)
115
115
  end
116
116
 
117
- it "redirects to stock locations page" do
117
+ it "redirects to stock locations page", js: false do
118
118
  expect(page).to have_content(Spree.t(:stock_management_requires_a_stock_location))
119
119
  expect(page.current_url).to include("admin/stock_locations")
120
120
  end
@@ -1,13 +1,13 @@
1
1
  # encoding: utf-8
2
2
  require 'spec_helper'
3
3
 
4
- describe "Variants", type: :feature, js: true do
4
+ describe "Variants", type: :feature do
5
5
  stub_authorization!
6
6
 
7
7
  let(:product) { create(:product_with_option_types, price: "1.99", cost_price: "1.00", weight: "2.5", height: "3.0", width: "1.0", depth: "1.5") }
8
8
 
9
9
  context "creating a new variant" do
10
- it "should allow an admin to create a new variant" do
10
+ it "should allow an admin to create a new variant", js: true do
11
11
  product.options.each do |option|
12
12
  create(:option_value, option_type: option.option_type)
13
13
  end
data/spec/spec_helper.rb CHANGED
@@ -50,7 +50,7 @@ require 'capybara/poltergeist'
50
50
  Capybara.javascript_driver = :poltergeist
51
51
 
52
52
  # Set timeout to something high enough to allow CI to pass
53
- Capybara.default_max_wait_time = 20
53
+ Capybara.default_max_wait_time = 10
54
54
 
55
55
  RSpec.configure do |config|
56
56
  config.color = true
@@ -1,25 +1,25 @@
1
1
  # encoding: UTF-8
2
- version = File.read(File.expand_path("../../SPREE_VERSION", __FILE__)).strip
2
+ require_relative '../core/lib/spree/core/version.rb'
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.name = 'spree_backend'
7
- s.version = version
7
+ s.version = Spree.version
8
8
  s.summary = 'backend e-commerce functionality for the Spree project.'
9
9
  s.description = 'Required dependency for Spree'
10
10
 
11
11
  s.author = 'Sean Schofield'
12
12
  s.email = 'sean@spreecommerce.com'
13
13
  s.homepage = 'https://spreecommerce.com'
14
- s.license = %q{BSD-3}
14
+ s.license = 'BSD-3'
15
15
  s.rubyforge_project = 'spree_backend'
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.require_path = 'lib'
19
19
  s.requirements << 'none'
20
20
 
21
- s.add_dependency 'spree_api', version
22
- s.add_dependency 'spree_core', version
21
+ s.add_dependency 'spree_api', s.version
22
+ s.add_dependency 'spree_core', s.version
23
23
 
24
24
  s.add_dependency 'bootstrap-sass', '~> 3.3'
25
25
  s.add_dependency 'jquery-rails', '~> 4.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_backend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Schofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_api
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 3.0.7
19
+ version: 3.0.8
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: 3.0.7
26
+ version: 3.0.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 3.0.7
33
+ version: 3.0.8
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: 3.0.7
40
+ version: 3.0.8
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bootstrap-sass
43
43
  requirement: !ruby/object:Gem::Requirement