Permalink
Browse files

Fixed bugs in the test suite from changes to stock adjustment logic.

  • Loading branch information...
1 parent 2cde4d0 commit 46268af455b8f2e6984ca0f473033680d7a1cf2d @Jellyfishboy committed Mar 28, 2016
View
@@ -1,2 +1,2 @@
---color
---format documentation
+--format Fuubar
+--color
View
@@ -29,6 +29,7 @@ group :test do
gem 'shoulda-matchers', '2.8.0'
gem 'faker'
gem 'email_spec'
+ gem 'fuubar'
end
group :development, :test do
View
@@ -293,6 +293,9 @@ GEM
friendly_id (5.1.0)
activerecord (>= 4.0.0)
fssm (0.2.10)
+ fuubar (2.0.0)
+ rspec (~> 3.0)
+ ruby-progressbar (~> 1.4)
git-version-bump (0.15.1)
globalid (0.3.6)
activesupport (>= 4.1.0)
@@ -480,6 +483,10 @@ GEM
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (1.4.1)
+ rspec (3.4.0)
+ rspec-core (~> 3.4.0)
+ rspec-expectations (~> 3.4.0)
+ rspec-mocks (~> 3.4.0)
rspec-collection_matchers (1.1.2)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.4.1)
@@ -499,6 +506,7 @@ GEM
rspec-mocks (~> 3.4.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
+ ruby-progressbar (1.7.5)
ruby_parser (3.7.2)
sexp_processor (~> 4.1)
sass (3.2.19)
@@ -608,6 +616,7 @@ DEPENDENCIES
fast_blank
fog
friendly_id
+ fuubar
gon
google-api-client
haml
@@ -646,4 +655,4 @@ DEPENDENCIES
whenever (>= 0.8.4)
BUNDLED WITH
- 1.10.6
+ 1.11.2
@@ -49,6 +49,7 @@
visit admin_delivery_services_path
find('.page-header a:first-child').click
+ sleep 1
expect(current_path).to eq new_admin_delivery_service_path
within '#breadcrumbs li.current' do
expect(page).to have_content 'New'
@@ -85,6 +86,7 @@
within 'thead.main-table + tbody' do
first('tr').find('td:last-child a:nth-child(2)').click
end
+ sleep 1
expect(current_path).to eq edit_admin_delivery_service_path(delivery_service_with_countries)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -110,6 +112,7 @@
visit admin_delivery_services_path
find('.page-header a:first-child').click
+ sleep 1
expect(current_path).to eq new_admin_delivery_service_path
within '#breadcrumbs li.current' do
expect(page).to have_content 'New'
@@ -37,6 +37,7 @@
visit admin_products_path
expect{
find('.page-header a:first-child').click
+ sleep 1
}.to change(Product, :count).by(1)
product = Product.where.not(id: product_1.id).first
expect(current_path).to eq edit_admin_product_path(product)
@@ -144,6 +145,7 @@
visit admin_products_path
find('.table-actions').first(:link).click
+ sleep 1
expect(current_path).to eq edit_admin_product_path(not_single_product)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -198,6 +200,7 @@
visit admin_products_path
expect{
find('.page-header a:first-child').click
+ sleep 1
}.to change(Product, :count).by(1)
product = Product.first
expect(current_path).to eq edit_admin_product_path(product)
@@ -259,6 +262,7 @@
visit admin_products_path
find('.table-actions').first(:link).click
+ sleep 1
expect(current_path).to eq edit_admin_product_path(product_skus)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -291,6 +295,7 @@
visit admin_products_path
find('.table-actions').first(:link).click
+ sleep 1
expect(current_path).to eq edit_admin_product_path(product_skus)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -369,6 +374,7 @@
visit admin_products_path
find('.table-actions').first(:link).click
+ sleep 1
expect(current_path).to eq edit_admin_product_path(product_skus)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -392,6 +398,7 @@
visit admin_products_path
find('.table-actions').first(:link).click
+ sleep 1
expect(current_path).to eq edit_admin_product_path(multi_attachment_product)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -472,6 +479,7 @@
visit admin_products_path
find('.table-actions').first(:link).click
+ sleep 1
expect(current_path).to eq edit_admin_product_path(multi_attachment_product)
within '#breadcrumbs li.current' do
expect(page).to have_content 'Edit'
@@ -35,6 +35,7 @@
within '.page-header' do
find('a:nth-child(2)').click
end
+ sleep 1
expect(current_path).to eq admin_products_stock_index_path
within 'tbody' do
first('tr').find('td:last-child a:first-child').trigger('click')
@@ -42,22 +42,6 @@
expect(sku).to have(1).error_on(:sku)
expect(sku.errors.messages[:sku]).to eq ["stock warning level value must be below your stock count."]
end
-
- it "should create a new stock adjustment record" do
- expect{
- create_sku
- }.to change(StockAdjustment, :count).by(1)
- end
-
- it "should set the stock adjustment record as 'Initial stock'" do
- create_sku
- expect(create_sku.stock_adjustments.first.description).to eq 'Initial stock'
- end
-
- it "should set the stock adjustment record adjustment as the SKU's stock" do
- create_sku
- expect(create_sku.stock_adjustments.first.adjustment).to eq 55
- end
end
describe "Listing all SKUs" do
View
@@ -75,4 +75,5 @@
mocks.verify_partial_doubles = true
end
=end
+ config.fuubar_progress_bar_options = { :format => ' Trado tests processing... <%B> %p%% %a' }
end

0 comments on commit 46268af

Please sign in to comment.