solidus_multi_domain 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62d8d93fb78e41df98961c5facc8ab53417b26ed
4
- data.tar.gz: ab6e798427dd7e4a97d24208a0aa0e4355d817c7
3
+ metadata.gz: 6efd8a195f9ef9cce20361a7fda8a8a97a32d769
4
+ data.tar.gz: ee4102db3fbc47787f5d4446a92d1ac53d73a8af
5
5
  SHA512:
6
- metadata.gz: 5f2bd59b62385a6b435b39238db873295ac54403dc373c25ce5b342297ad9c26d76224c9952832d62c0cffc9716df8926002e0dcf72308957e276262d18ebe96
7
- data.tar.gz: dcd46d85d0f7850db4b465e7b2d037e7ede7f3a5a3766eb45bd810b738e68e9545fdfabaf0d9de1bfab9b88953c59e1358c6923d548afdeffe4a61346898a47e
6
+ metadata.gz: 8a9f833abc9d7bbd3f5c22281093d773305e1a19e6c68ff9c9d15adaf68c8832803f3c328c18ea6a360309c84cb3bd22bcd12b31ae6e782c76b78efa4bf06d78
7
+ data.tar.gz: 76e9eca1a23e3c0e96fc2eb4a56357c26cad4b97fe3e7f518735c05b5ad36fdca6a1fca8b14901e139b0a9c91ac34beaf78ce2f20f6dc1b8795cf14203fd1224
@@ -4,7 +4,7 @@ $.fn.storeAutocomplete = function() {
4
4
  multiple: true,
5
5
  initSelection: function(element, callback) {
6
6
  $.get(Spree.routes.store_search, { ids: element.val() }, function(data) {
7
- callback(data.stores)
7
+ callback(data)
8
8
  })
9
9
  },
10
10
  ajax: {
@@ -14,7 +14,7 @@ $.fn.storeAutocomplete = function() {
14
14
  return { q: term }
15
15
  },
16
16
  results: function(data, page) {
17
- return { results: data.stores }
17
+ return { results: data }
18
18
  }
19
19
  },
20
20
  formatResult: function(store) {
@@ -28,7 +28,3 @@ $.fn.storeAutocomplete = function() {
28
28
  }
29
29
  });
30
30
  }
31
-
32
- $(document).ready(function () {
33
- $('.store_picker').storeAutocomplete();
34
- })
@@ -3,7 +3,7 @@
3
3
  Gem::Specification.new do |s|
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.name = "solidus_multi_domain"
6
- s.version = "1.4.1"
6
+ s.version = "1.4.2"
7
7
  s.summary = "Adds multiple site support to Solidus"
8
8
  s.description = "Multiple Solidus stores on different domains - single unified backed for processing orders."
9
9
  s.required_ruby_version = ">= 2.1"
@@ -28,5 +28,8 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency "coffee-rails"
29
29
  s.add_development_dependency "factory_girl", "~> 4.5"
30
30
  s.add_development_dependency "capybara"
31
+ s.add_development_dependency "poltergeist"
32
+ s.add_development_dependency "capybara-screenshot"
33
+ s.add_development_dependency "database_cleaner"
31
34
  s.add_development_dependency "ffaker"
32
35
  end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe "Store promotion rule", js: true do
4
+ stub_authorization!
5
+
6
+ let!(:store) { create(:store, name: "Real fake doors") }
7
+ let!(:promotion) { create(:promotion) }
8
+
9
+ it "Can add a store rule to a promotion" do
10
+ visit spree.edit_admin_promotion_path(promotion)
11
+
12
+ select2 "Store", from: "Add rule of type"
13
+ within("#rules_container") { click_button "Add" }
14
+
15
+ select2_search store.name, from: "Choose Stores"
16
+
17
+ within("#rules_container") { click_button "Update" }
18
+ expect(page).to have_content('successfully updated')
19
+ end
20
+ end
data/spec/spec_helper.rb CHANGED
@@ -8,15 +8,25 @@ require File.expand_path("../dummy/config/environment.rb", __FILE__)
8
8
  require 'rspec/rails'
9
9
  require 'ffaker'
10
10
 
11
+ require 'database_cleaner'
12
+ require 'capybara/rspec'
13
+ require 'capybara-screenshot/rspec'
14
+ require 'capybara/poltergeist'
15
+ Capybara.register_driver(:poltergeist) do |app|
16
+ Capybara::Poltergeist::Driver.new app, timeout: 90
17
+ end
18
+ Capybara.javascript_driver = :poltergeist
19
+ Capybara.default_max_wait_time = 10
20
+
11
21
  # Requires factories defined in spree_core
12
22
  require 'spree/testing_support/factories'
13
23
  require 'spree_multi_domain/testing_support/factory_overrides'
14
24
  require 'spree/testing_support/controller_requests'
15
25
  require 'spree/testing_support/authorization_helpers'
16
26
  require 'spree/testing_support/preferences'
17
-
18
27
  require 'spree/api/testing_support/helpers'
19
28
  require 'spree/api/testing_support/setup'
29
+ require 'spree/testing_support/capybara_ext'
20
30
 
21
31
  require 'cancan/matchers'
22
32
 
@@ -28,9 +38,22 @@ RSpec.configure do |config|
28
38
 
29
39
  config.filter_run focus: true
30
40
  config.run_all_when_everything_filtered = true
31
- config.use_transactional_fixtures = true
41
+ config.use_transactional_fixtures = false
32
42
 
33
43
  config.include FactoryGirl::Syntax::Methods
34
44
  config.include Spree::TestingSupport::ControllerRequests, type: :controller
35
45
  config.include Spree::Api::TestingSupport::Helpers, type: :controller
46
+
47
+ config.before :suite do
48
+ DatabaseCleaner.clean_with :truncation
49
+ end
50
+
51
+ config.before do
52
+ DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
53
+ DatabaseCleaner.start
54
+ end
55
+
56
+ config.after do
57
+ DatabaseCleaner.clean
58
+ end
36
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_multi_domain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-13 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus
@@ -136,6 +136,48 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: poltergeist
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: capybara-screenshot
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: database_cleaner
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
139
181
  - !ruby/object:Gem::Dependency
140
182
  name: ffaker
141
183
  requirement: !ruby/object:Gem::Requirement
@@ -242,6 +284,7 @@ files:
242
284
  - spec/controllers/spree/api/products_controller_spec.rb
243
285
  - spec/controllers/spree/api/shipments_controller_spec.rb
244
286
  - spec/controllers/spree/products_controller_spec.rb
287
+ - spec/features/admin/promotion_rule_store_spec.rb
245
288
  - spec/helpers/products_helper_decorator_spec.rb
246
289
  - spec/lib/spree_multi_domain/testing_support/factory_overrides_spec.rb
247
290
  - spec/models/spree/line_item_spec.rb
@@ -289,6 +332,7 @@ test_files:
289
332
  - spec/controllers/spree/api/products_controller_spec.rb
290
333
  - spec/controllers/spree/api/shipments_controller_spec.rb
291
334
  - spec/controllers/spree/products_controller_spec.rb
335
+ - spec/features/admin/promotion_rule_store_spec.rb
292
336
  - spec/helpers/products_helper_decorator_spec.rb
293
337
  - spec/lib/spree_multi_domain/testing_support/factory_overrides_spec.rb
294
338
  - spec/models/spree/line_item_spec.rb