Commit 047a76009a869baef2f58023f42ea7e5388c1381
1 parent
4434f93a
Exists in
spb-stable
and in
3 other branches
Remove chosen from tests
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
4 changed files
with
9 additions
and
30 deletions
Show diff stats
features/steps/project/project_forked_merge_requests.rb
| ... | ... | @@ -42,14 +42,14 @@ class ProjectForkedMergeRequests < Spinach::FeatureSteps |
| 42 | 42 | end |
| 43 | 43 | |
| 44 | 44 | step 'I fill out a "Merge Request On Forked Project" merge request' do |
| 45 | - chosen @forked_project.id, from: "#merge_request_source_project_id" | |
| 46 | - chosen @project.id, from: "#merge_request_target_project_id" | |
| 45 | + select2 @forked_project.id, from: "#merge_request_source_project_id" | |
| 46 | + select2 @project.id, from: "#merge_request_target_project_id" | |
| 47 | 47 | |
| 48 | 48 | find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s |
| 49 | 49 | find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s |
| 50 | 50 | |
| 51 | - chosen "master", from: "#merge_request_source_branch" | |
| 52 | - chosen "stable", from: "#merge_request_target_branch" | |
| 51 | + select2 "master", from: "#merge_request_source_branch" | |
| 52 | + select2 "stable", from: "#merge_request_target_branch" | |
| 53 | 53 | |
| 54 | 54 | find(:select, "merge_request_source_branch", {}).value.should == 'master' |
| 55 | 55 | find(:select, "merge_request_target_branch", {}).value.should == 'stable' | ... | ... |
features/steps/project/project_network_graph.rb
| ... | ... | @@ -15,11 +15,11 @@ class ProjectNetworkGraph < Spinach::FeatureSteps |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | And 'page should select "master" in select box' do |
| 18 | - page.should have_selector '.chosen-single span', text: "master" | |
| 18 | + page.should have_selector '.select2-chosen', text: "master" | |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | And 'page should select "v2.1.0" in select box' do |
| 22 | - page.should have_selector '.chosen-single span', text: "v2.1.0" | |
| 22 | + page.should have_selector '.select2-chosen', text: "v2.1.0" | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | And 'page should have "master" on graph' do |
| ... | ... | @@ -56,11 +56,11 @@ class ProjectNetworkGraph < Spinach::FeatureSteps |
| 56 | 56 | end |
| 57 | 57 | |
| 58 | 58 | And 'page should select "stable" in select box' do |
| 59 | - page.should have_selector '.chosen-single span', text: "stable" | |
| 59 | + page.should have_selector '.select2-chosen', text: "stable" | |
| 60 | 60 | end |
| 61 | 61 | |
| 62 | 62 | And 'page should select "v2.1.0" in select box' do |
| 63 | - page.should have_selector '.chosen-single span', text: "v2.1.0" | |
| 63 | + page.should have_selector '.select2-chosen', text: "v2.1.0" | |
| 64 | 64 | end |
| 65 | 65 | |
| 66 | 66 | And 'page should have "stable" on graph' do | ... | ... |
features/support/env.rb
| ... | ... | @@ -15,7 +15,7 @@ require 'spinach/capybara' |
| 15 | 15 | require 'sidekiq/testing/inline' |
| 16 | 16 | |
| 17 | 17 | |
| 18 | -%w(valid_commit big_commits select2_helper chosen_helper test_env).each do |f| | |
| 18 | +%w(valid_commit big_commits select2_helper test_env).each do |f| | |
| 19 | 19 | require Rails.root.join('spec', 'support', f) |
| 20 | 20 | end |
| 21 | 21 | ... | ... |
spec/support/chosen_helper.rb
| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | -# Chosen programmatic helper | |
| 2 | -# It allows you to select value from chosen select | |
| 3 | -# | |
| 4 | -# Params | |
| 5 | -# value - real value of selected item | |
| 6 | -# opts - options containing css selector | |
| 7 | -# | |
| 8 | -# Usage: | |
| 9 | -# | |
| 10 | -# chosen(2, from: '#user_ids') | |
| 11 | -# | |
| 12 | - | |
| 13 | -module ChosenHelper | |
| 14 | - def chosen(value, options={}) | |
| 15 | - raise "Must pass a hash containing 'from'" if not options.is_a?(Hash) or not options.has_key?(:from) | |
| 16 | - | |
| 17 | - selector = options[:from] | |
| 18 | - | |
| 19 | - page.execute_script("$('#{selector}').val('#{value}').trigger('chosen:updated');") | |
| 20 | - end | |
| 21 | -end |