diff options
-rw-r--r-- | features/steps/project/project_forked_merge_requests.rb | 8 | ||||
-rw-r--r-- | features/steps/project/project_network_graph.rb | 8 | ||||
-rw-r--r-- | features/support/env.rb | 2 | ||||
-rw-r--r-- | spec/support/chosen_helper.rb | 21 |
4 files changed, 9 insertions, 30 deletions
diff --git a/features/steps/project/project_forked_merge_requests.rb b/features/steps/project/project_forked_merge_requests.rb index f7bf085a423..ec15232e4d0 100644 --- a/features/steps/project/project_forked_merge_requests.rb +++ b/features/steps/project/project_forked_merge_requests.rb @@ -42,14 +42,14 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I fill out a "Merge Request On Forked Project" merge request' do - chosen @forked_project.id, from: "#merge_request_source_project_id" - chosen @project.id, from: "#merge_request_target_project_id" + select2 @forked_project.id, from: "#merge_request_source_project_id" + select2 @project.id, from: "#merge_request_target_project_id" find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s - chosen "master", from: "#merge_request_source_branch" - chosen "stable", from: "#merge_request_target_branch" + select2 "master", from: "#merge_request_source_branch" + select2 "stable", from: "#merge_request_target_branch" find(:select, "merge_request_source_branch", {}).value.should == 'master' find(:select, "merge_request_target_branch", {}).value.should == 'stable' diff --git a/features/steps/project/project_network_graph.rb b/features/steps/project/project_network_graph.rb index 76a62acab82..bc228e6e68a 100644 --- a/features/steps/project/project_network_graph.rb +++ b/features/steps/project/project_network_graph.rb @@ -15,11 +15,11 @@ class ProjectNetworkGraph < Spinach::FeatureSteps end And 'page should select "master" in select box' do - page.should have_selector '.chosen-single span', text: "master" + page.should have_selector '.select2-chosen', text: "master" end And 'page should select "v2.1.0" in select box' do - page.should have_selector '.chosen-single span', text: "v2.1.0" + page.should have_selector '.select2-chosen', text: "v2.1.0" end And 'page should have "master" on graph' do @@ -56,11 +56,11 @@ class ProjectNetworkGraph < Spinach::FeatureSteps end And 'page should select "stable" in select box' do - page.should have_selector '.chosen-single span', text: "stable" + page.should have_selector '.select2-chosen', text: "stable" end And 'page should select "v2.1.0" in select box' do - page.should have_selector '.chosen-single span', text: "v2.1.0" + page.should have_selector '.select2-chosen', text: "v2.1.0" end And 'page should have "stable" on graph' do diff --git a/features/support/env.rb b/features/support/env.rb index 64cdc7f5bf1..0186002c559 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -15,7 +15,7 @@ require 'spinach/capybara' require 'sidekiq/testing/inline' -%w(valid_commit big_commits select2_helper chosen_helper test_env).each do |f| +%w(valid_commit big_commits select2_helper test_env).each do |f| require Rails.root.join('spec', 'support', f) end diff --git a/spec/support/chosen_helper.rb b/spec/support/chosen_helper.rb deleted file mode 100644 index 42c9342c77a..00000000000 --- a/spec/support/chosen_helper.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Chosen programmatic helper -# It allows you to select value from chosen select -# -# Params -# value - real value of selected item -# opts - options containing css selector -# -# Usage: -# -# chosen(2, from: '#user_ids') -# - -module ChosenHelper - def chosen(value, options={}) - raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from) - - selector = options[:from] - - page.execute_script("$('#{selector}').val('#{value}').trigger('chosen:updated');") - end -end |