Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests and issue with shipment ransack #78

Open
wants to merge 3 commits into
base: 3-0-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/spree/shipment_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

delegate :supplier, to: :stock_location

self.whitelisted_ransackable_attributes = ["number", "state"]

def display_final_price_with_items
Spree::Money.new final_price_with_items
end
Expand Down
5 changes: 4 additions & 1 deletion spec/features/admin/stock_management_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
@v.stock_items.first.update_column(:count_on_hand, 10)
@secondary.stock_item(@v).destroy
click_link "Products"
sleep(1)
within '#sidebar-product' do
click_link 'Products'
click_link "Products"
end
click_link @product.name
within '[data-hook=admin_product_tabs]' do
Expand Down Expand Up @@ -111,6 +112,7 @@
v.stock_items.first.update_column(:count_on_hand, 30)

click_link "Products"
sleep(1)
within '#sidebar-product' do
click_link 'Products'
end
Expand Down Expand Up @@ -138,6 +140,7 @@
@product.variants.create!(sku: 'FOOBAR')
Spree::StockLocation.delete_all
click_link "Products"
sleep(1)
within '#sidebar-product' do
click_link 'Products'
end
Expand Down
7 changes: 7 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@
config.color = true
config.infer_spec_type_from_file_location!
end

Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end
2 changes: 1 addition & 1 deletion spree_drop_ship.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'ffaker'
s.add_development_dependency 'launchy'
s.add_development_dependency 'rspec-rails', '~> 2.99'
s.add_development_dependency 'sass-rails', '~> 4.0.2'
s.add_development_dependency 'sass-rails', '~> 5.0.0.beta1'
s.add_development_dependency 'selenium-webdriver'
s.add_development_dependency 'shoulda-matchers'
s.add_development_dependency 'spree_auth_devise'
Expand Down