Commit aad78d68 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'fix-hash-syntax-for-boards' into 'master'

Use Ruby 2.1-compatible hash syntax for boards

This broke the master build, because we only run Ruby 2.1 specs on master. https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6978 wouldn't help because this is in Haml 😞

See merge request !808
parents 83b0fe93 b60faa3c
......@@ -51,11 +51,11 @@
.dropdown-footer{ "v-if" => "currentPage === ''" }
%ul.dropdown-footer-list
%li
%a{ "href": "#", "@click.stop.prevent" => "showPage('new')" }
%a{ "href" => "#", "@click.stop.prevent" => "showPage('new')" }
Create new board
%li
%a{ "href": "#", "@click.stop.prevent" => "showPage('edit')" }
%a{ "href" => "#", "@click.stop.prevent" => "showPage('edit')" }
Edit board name
%li{ "v-if" => "showDelete" }
%a.text-danger{ "href": "#", "@click.stop.prevent" => "showPage('delete')" }
%a.text-danger{ "href" => "#", "@click.stop.prevent" => "showPage('delete')" }
Delete board
......@@ -9,6 +9,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
include SharedUser
include WaitForAjax
after do
wait_for_ajax if javascript_test?
end
step 'I click link "New Merge Request"' do
click_link "New Merge Request"
end
......
require Rails.root.join('features/support/wait_for_ajax')
module SharedNote
include Spinach::DSL
include WaitForAjax
......
......@@ -15,7 +15,7 @@ if ENV['CI']
Knapsack::Adapters::SpinachAdapter.bind
end
%w(select2_helper test_env repo_helpers license).each do |f|
%w(select2_helper test_env repo_helpers license wait_for_ajax).each do |f|
require Rails.root.join('spec', 'support', f)
end
......
module WaitForAjax
def wait_for_ajax
Timeout.timeout(Capybara.default_max_wait_time) do
loop until finished_all_ajax_requests?
end
end
def finished_all_ajax_requests?
page.evaluate_script('jQuery.active').zero?
end
end
......@@ -8,4 +8,8 @@ module WaitForAjax
def finished_all_ajax_requests?
page.evaluate_script('jQuery.active').zero?
end
def javascript_test?
[:selenium, :webkit, :chrome, :poltergeist].include?(Capybara.current_driver)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment