Fix failing tests

This commit is contained in:
wvengen 2016-02-18 22:34:06 +01:00
parent a1a7bb02fe
commit d6bf09b0b8
4 changed files with 20 additions and 11 deletions

View file

@ -35,7 +35,7 @@ gem 'simple-navigation', '~> 3.14.0' # 3.x for simple_navigation_bootstrap
gem 'simple-navigation-bootstrap' gem 'simple-navigation-bootstrap'
gem 'ransack' gem 'ransack'
gem 'acts_as_tree' gem 'acts_as_tree'
gem 'rails-settings-cached' gem 'rails-settings-cached', '= 0.4.3' # caching breaks tests until Rails 5 https://github.com/huacnlee/rails-settings-cached/issues/73
gem 'resque' gem 'resque'
gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb
gem 'protected_attributes', '= 1.1.0' # 1.1.0 until tests work work with higher versions gem 'protected_attributes', '= 1.1.0' # 1.1.0 until tests work work with higher versions

View file

@ -151,7 +151,7 @@ GEM
expression_parser (0.9.0) expression_parser (0.9.0)
factory_girl (4.5.0) factory_girl (4.5.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.5.0) factory_girl_rails (4.6.0)
factory_girl (~> 4.5.0) factory_girl (~> 4.5.0)
railties (>= 3.0.0) railties (>= 3.0.0)
faker (1.6.1) faker (1.6.1)
@ -215,10 +215,11 @@ GEM
nokogiri (>= 1.5.9) nokogiri (>= 1.5.9)
mail (2.6.3) mail (2.6.3)
mime-types (>= 1.16, < 3) mime-types (>= 1.16, < 3)
mailcatcher (0.6.3) mailcatcher (0.6.4)
activesupport (>= 4.0.0, < 5) activesupport (~> 4.0)
eventmachine (= 1.0.9.1) eventmachine (= 1.0.9.1)
mail (~> 2.3) mail (~> 2.3)
rack (~> 1.5)
sinatra (~> 1.2) sinatra (~> 1.2)
skinny (~> 0.2.3) skinny (~> 0.2.3)
sqlite3 (~> 1.3) sqlite3 (~> 1.3)
@ -295,7 +296,7 @@ GEM
rails-i18n (4.0.8) rails-i18n (4.0.8)
i18n (~> 0.7) i18n (~> 0.7)
railties (~> 4.0) railties (~> 4.0)
rails-settings-cached (0.5.3) rails-settings-cached (0.4.3)
rails (>= 4.2.0) rails (>= 4.2.0)
rails_tokeninput (1.7.0) rails_tokeninput (1.7.0)
railties (>= 3.1.0) railties (>= 3.1.0)
@ -352,7 +353,7 @@ GEM
rspec-mocks (3.4.1) rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0) diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0) rspec-support (~> 3.4.0)
rspec-rails (3.4.1) rspec-rails (3.4.2)
actionpack (>= 3.0, < 4.3) actionpack (>= 3.0, < 4.3)
activesupport (>= 3.0, < 4.3) activesupport (>= 3.0, < 4.3)
railties (>= 3.0, < 4.3) railties (>= 3.0, < 4.3)
@ -378,7 +379,7 @@ GEM
tilt (>= 1.1, < 3) tilt (>= 1.1, < 3)
select2-rails (4.0.1) select2-rails (4.0.1)
thor (~> 0.14) thor (~> 0.14)
selenium-webdriver (2.50.0) selenium-webdriver (2.49.0)
childprocess (~> 0.5) childprocess (~> 0.5)
multi_json (~> 1.0) multi_json (~> 1.0)
rubyzip (~> 1.0) rubyzip (~> 1.0)
@ -392,7 +393,7 @@ GEM
simple_form (3.2.1) simple_form (3.2.1)
actionpack (> 4, < 5.1) actionpack (> 4, < 5.1)
activemodel (> 4, < 5.1) activemodel (> 4, < 5.1)
simplecov (0.11.1) simplecov (0.11.2)
docile (~> 1.1.0) docile (~> 1.1.0)
json (~> 1.8) json (~> 1.8)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
@ -437,7 +438,7 @@ GEM
execjs execjs
rails (>= 3.1) rails (>= 3.1)
railties (>= 3.1) railties (>= 3.1)
twitter-text (1.13.0) twitter-text (1.13.3)
unf (~> 0.1.0) unf (~> 0.1.0)
tzinfo (1.2.2) tzinfo (1.2.2)
thread_safe (~> 0.1) thread_safe (~> 0.1)
@ -446,7 +447,7 @@ GEM
json (>= 1.8.0) json (>= 1.8.0)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.1) unf_ext (0.0.7.2)
uniform_notifier (1.9.0) uniform_notifier (1.9.0)
vegas (0.1.11) vegas (0.1.11)
rack (>= 1.0.0) rack (>= 1.0.0)
@ -516,7 +517,7 @@ DEPENDENCIES
rails (~> 4.2) rails (~> 4.2)
rails-assets-listjs (= 0.2.0.beta.4) rails-assets-listjs (= 0.2.0.beta.4)
rails-i18n rails-i18n
rails-settings-cached rails-settings-cached (= 0.4.3)
rails_tokeninput rails_tokeninput
ransack ransack
recurring_select recurring_select

View file

@ -22,6 +22,7 @@ feature 'product distribution', js: true do
# gruppe a bestellt 2(3), weil sie auf jeden fall was von x bekommen will # gruppe a bestellt 2(3), weil sie auf jeden fall was von x bekommen will
login user_a login user_a
visit new_group_order_path(order_id: order.id) visit new_group_order_path(order_id: order.id)
scrolldown
2.times { find("[data-increase_quantity='#{oa.id}']").click } 2.times { find("[data-increase_quantity='#{oa.id}']").click }
3.times { find("[data-increase_tolerance='#{oa.id}']").click } 3.times { find("[data-increase_tolerance='#{oa.id}']").click }
find('input[type=submit]').click find('input[type=submit]').click
@ -29,12 +30,14 @@ feature 'product distribution', js: true do
# gruppe b bestellt 2(0) # gruppe b bestellt 2(0)
login user_b login user_b
visit new_group_order_path(order_id: order.id) visit new_group_order_path(order_id: order.id)
scrolldown
2.times { find("[data-increase_quantity='#{oa.id}']").click } 2.times { find("[data-increase_quantity='#{oa.id}']").click }
find('input[type=submit]').click find('input[type=submit]').click
expect(page).to have_selector('body') expect(page).to have_selector('body')
# gruppe a faellt ein dass sie doch noch mehr braucht von x und aendert auf 4(1). # gruppe a faellt ein dass sie doch noch mehr braucht von x und aendert auf 4(1).
login user_a login user_a
visit edit_group_order_path(id: order.group_order(user_a.ordergroup).id, order_id: order.id) visit edit_group_order_path(id: order.group_order(user_a.ordergroup).id, order_id: order.id)
scrolldown
2.times { find("[data-increase_quantity='#{oa.id}']").click } 2.times { find("[data-increase_quantity='#{oa.id}']").click }
2.times { find("[data-decrease_tolerance='#{oa.id}']").click } 2.times { find("[data-decrease_tolerance='#{oa.id}']").click }
find('input[type=submit]').click find('input[type=submit]').click

View file

@ -0,0 +1,5 @@
# @see http://stackoverflow.com/a/11048669/2866660
def scrolldown
page.execute_script "window.scrollBy(0,10000)"
end