diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-26 23:51:05 +0800 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-06-12 18:40:18 +0800 |
commit | 96ed5a8bd78f90b0c7a8b044c4bd99e3af46dd71 (patch) | |
tree | df517f916e5bfcbf1420c092ebf55ac3e1bab5ee /spec/features/projects | |
parent | 06e89d786c4ac67d9262c576b9aadb7d40dee9c2 (diff) | |
download | gitlab-ce-96ed5a8bd78f90b0c7a8b044c4bd99e3af46dd71.tar.gz |
Upgrade to Capybara 3
Fix whitespace in specs because normalize_ws is slightly
different from Capybara 2 behavior
Diffstat (limited to 'spec/features/projects')
8 files changed, 8 insertions, 8 deletions
diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index 953517cdff9..a84fee34669 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -13,7 +13,7 @@ describe 'User browses commits' do it 'renders commit' do visit project_commit_path(project, sample_commit.id) - expect(page).to have_content(sample_commit.message) + expect(page).to have_content(sample_commit.message.gsub!(/\s+/, ' ')) .and have_content("Showing #{sample_commit.files_changed_count} changed files") .and have_content('Side-by-side') end diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb index ab16fdee883..254e885ce46 100644 --- a/spec/features/projects/features_visibility_spec.rb +++ b/spec/features/projects/features_visibility_spec.rb @@ -68,7 +68,8 @@ describe 'Edit Project Settings' do end it "hides builds when disabled" do - allow(Ability).to receive(:allowed?).with(member, :read_builds, project).and_return(false) + allow(Ability).to receive(:allowed?).and_return(true) + allow(Ability).to receive(:allowed?).with(member, :read_build, project).and_return(false) visit project_pipelines_path(project) diff --git a/spec/features/projects/files/undo_template_spec.rb b/spec/features/projects/files/undo_template_spec.rb index fa785ed10ef..91618145391 100644 --- a/spec/features/projects/files/undo_template_spec.rb +++ b/spec/features/projects/files/undo_template_spec.rb @@ -50,7 +50,7 @@ end def check_content_reverted(template_content) find('.template-selectors-undo-menu .btn-info').click expect(page).not_to have_content(template_content) - expect(find('.template-type-selector .dropdown-toggle-text')).to have_content + expect(page).to have_css('.template-type-selector .dropdown-toggle-text') end def select_file_template(template_selector_selector, template_name) diff --git a/spec/features/projects/files/user_creates_files_spec.rb b/spec/features/projects/files/user_creates_files_spec.rb index 69f8bd4d319..264b288ab38 100644 --- a/spec/features/projects/files/user_creates_files_spec.rb +++ b/spec/features/projects/files/user_creates_files_spec.rb @@ -174,7 +174,6 @@ describe 'Projects > Files > User creates files' do it 'creates and commit new file in forked project', :js do expect(page).to have_selector('.file-editor') - expect(page).to have_content find('#editor') execute_script("ace.edit('editor').setValue('*.rbca')") diff --git a/spec/features/projects/labels/user_removes_labels_spec.rb b/spec/features/projects/labels/user_removes_labels_spec.rb index c231e54decd..7f49ddf560f 100644 --- a/spec/features/projects/labels/user_removes_labels_spec.rb +++ b/spec/features/projects/labels/user_removes_labels_spec.rb @@ -41,7 +41,7 @@ describe "User removes labels" do it "removes all labels" do loop do - li = page.first(".label-list-item") + li = page.first(".label-list-item", minimum: 0) break unless li li.find('.js-label-options-dropdown').click diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 1de153db41c..77f0f237d0a 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -91,7 +91,7 @@ describe 'Pipeline', :js do within '.pipeline-info' do expect(page).to have_content("#{pipeline.statuses.count} jobs " \ - "for #{pipeline.ref} ") + "for #{pipeline.ref}") expect(page).to have_link(pipeline.ref, href: project_commits_path(pipeline.project, pipeline.ref)) end diff --git a/spec/features/projects/settings/integration_settings_spec.rb b/spec/features/projects/settings/integration_settings_spec.rb index 32959969f54..016ccf63f58 100644 --- a/spec/features/projects/settings/integration_settings_spec.rb +++ b/spec/features/projects/settings/integration_settings_spec.rb @@ -41,7 +41,7 @@ describe 'Projects > Settings > Integration settings' do expect(page).to have_content('Issues events') expect(page).to have_content('Confidential issues events') expect(page).to have_content('Note events') - expect(page).to have_content('Merge requests events') + expect(page).to have_content('Merge requests events') expect(page).to have_content('Pipeline events') expect(page).to have_content('Wiki page events') end diff --git a/spec/features/projects/tree/upload_file_spec.rb b/spec/features/projects/tree/upload_file_spec.rb index dcf7d314f8e..e5dd2f40fdf 100644 --- a/spec/features/projects/tree/upload_file_spec.rb +++ b/spec/features/projects/tree/upload_file_spec.rb @@ -29,6 +29,6 @@ describe 'Multi-file editor upload file', :js do attach_file('file-upload', txt_file) expect(page).to have_selector('.multi-file-tab', text: 'doc_sample.txt') - expect(find('.blob-editor-container .lines-content')['innerText']).to have_content(File.open(txt_file, &:readline)) + expect(find('.blob-editor-container .lines-content')['innerText']).to have_content(File.open(txt_file, &:readline).gsub!(/\s+/, ' ')) end end |