diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 21:09:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-26 21:09:24 +0300 |
commit | 619d0b6922a6cf95d291fbbf5fa3d09e772a1ea8 (patch) | |
tree | fb8f8e036cec1b32166206bb5102af6c5dca8cfe /spec/features/projects | |
parent | 17ab40ca089e1aef61a83f77ab6df62a72f6ce06 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects')
18 files changed, 55 insertions, 48 deletions
diff --git a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb index fb70076fcf1..3cbf276c02d 100644 --- a/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb +++ b/spec/features/projects/artifacts/user_downloads_artifacts_spec.rb @@ -3,9 +3,9 @@ require "spec_helper" describe "User downloads artifacts" do - set(:project) { create(:project, :repository, :public) } - set(:pipeline) { create(:ci_empty_pipeline, status: :success, sha: project.commit.id, project: project) } - set(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } + let_it_be(:project) { create(:project, :repository, :public) } + let_it_be(:pipeline) { create(:ci_empty_pipeline, status: :success, sha: project.commit.id, project: project) } + let_it_be(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } shared_examples "downloading" do it "downloads the zip" do diff --git a/spec/features/projects/badges/pipeline_badge_spec.rb b/spec/features/projects/badges/pipeline_badge_spec.rb index 5ddaf1e1591..b2f09a9d0b7 100644 --- a/spec/features/projects/badges/pipeline_badge_spec.rb +++ b/spec/features/projects/badges/pipeline_badge_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Pipeline Badge' do - set(:project) { create(:project, :repository, :public) } + let_it_be(:project) { create(:project, :repository, :public) } let(:ref) { project.default_branch } context 'when the project has a pipeline' do diff --git a/spec/features/projects/branches/user_deletes_branch_spec.rb b/spec/features/projects/branches/user_deletes_branch_spec.rb index ad63a75a149..184954c1c78 100644 --- a/spec/features/projects/branches/user_deletes_branch_spec.rb +++ b/spec/features/projects/branches/user_deletes_branch_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" describe "User deletes branch", :js do - set(:user) { create(:user) } + let_it_be(:user) { create(:user) } let(:project) { create(:project, :repository) } before do diff --git a/spec/features/projects/branches/user_views_branches_spec.rb b/spec/features/projects/branches/user_views_branches_spec.rb index f3810611094..e127e784b94 100644 --- a/spec/features/projects/branches/user_views_branches_spec.rb +++ b/spec/features/projects/branches/user_views_branches_spec.rb @@ -3,8 +3,8 @@ require "spec_helper" describe "User views branches" do - set(:project) { create(:project, :repository) } - set(:user) { project.owner } + let_it_be(:project) { create(:project, :repository) } + let_it_be(:user) { project.owner } before do sign_in(user) @@ -23,7 +23,7 @@ describe "User views branches" do end context "protected branches" do - set(:protected_branch) { create(:protected_branch, project: project) } + let_it_be(:protected_branch) { create(:protected_branch, project: project) } before do visit(project_protected_branches_path(project)) diff --git a/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb b/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb index e78b7f7ae08..c07f6081d2c 100644 --- a/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb +++ b/spec/features/projects/commit/user_views_user_status_on_commit_spec.rb @@ -5,8 +5,8 @@ require 'spec_helper' describe 'Project > Commit > View user status' do include RepoHelpers - set(:project) { create(:project, :repository) } - set(:user) { create(:user) } + let_it_be(:project) { create(:project, :repository) } + let_it_be(:user) { create(:user) } let(:commit_author) { create(:user, email: sample_commit.author_email) } before do diff --git a/spec/features/projects/labels/user_creates_labels_spec.rb b/spec/features/projects/labels/user_creates_labels_spec.rb index 257e064ae3d..180cd8eff14 100644 --- a/spec/features/projects/labels/user_creates_labels_spec.rb +++ b/spec/features/projects/labels/user_creates_labels_spec.rb @@ -3,8 +3,8 @@ require "spec_helper" describe "User creates labels" do - set(:project) { create(:project_empty_repo, :public) } - set(:user) { create(:user) } + let_it_be(:project) { create(:project_empty_repo, :public) } + let_it_be(:user) { create(:user) } shared_examples_for "label creation" do it "creates new label" do @@ -66,7 +66,7 @@ describe "User creates labels" do end context "in another project" do - set(:another_project) { create(:project_empty_repo, :public) } + let_it_be(:another_project) { create(:project_empty_repo, :public) } before do create(:label, project: project, title: "bug") # Create label for `project` (not `another_project`) project. diff --git a/spec/features/projects/labels/user_edits_labels_spec.rb b/spec/features/projects/labels/user_edits_labels_spec.rb index da33ae3af3a..add959ccda6 100644 --- a/spec/features/projects/labels/user_edits_labels_spec.rb +++ b/spec/features/projects/labels/user_edits_labels_spec.rb @@ -3,9 +3,9 @@ require "spec_helper" describe "User edits labels" do - set(:project) { create(:project_empty_repo, :public) } - set(:label) { create(:label, project: project) } - set(:user) { create(:user) } + let_it_be(:project) { create(:project_empty_repo, :public) } + let_it_be(:label) { create(:label, project: project) } + let_it_be(:user) { create(:user) } before do project.add_maintainer(user) diff --git a/spec/features/projects/labels/user_promotes_label_spec.rb b/spec/features/projects/labels/user_promotes_label_spec.rb index fdecafd4c50..cf7320d3cf9 100644 --- a/spec/features/projects/labels/user_promotes_label_spec.rb +++ b/spec/features/projects/labels/user_promotes_label_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'User promotes label' do - set(:group) { create(:group) } - set(:user) { create(:user) } - set(:project) { create(:project, namespace: group) } - set(:label) { create(:label, project: project) } + let_it_be(:group) { create(:group) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, namespace: group) } + let_it_be(:label) { create(:label, project: project) } context 'when user can admin group labels' do before do diff --git a/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb b/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb index 7a9b9e6eac2..f60e7e9703f 100644 --- a/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb +++ b/spec/features/projects/labels/user_sees_links_to_issuables_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Projects > Labels > User sees links to issuables' do - set(:user) { create(:user) } + let_it_be(:user) { create(:user) } before do label # creates the label @@ -50,7 +50,7 @@ describe 'Projects > Labels > User sees links to issuables' do end context 'with a group label' do - set(:group) { create(:group) } + let_it_be(:group) { create(:group) } let(:label) { create(:group_label, group: group, title: 'bug') } context 'when merge requests and issues are enabled for the project' do diff --git a/spec/features/projects/labels/user_views_labels_spec.rb b/spec/features/projects/labels/user_views_labels_spec.rb index a6f7968c535..7f70ac903d6 100644 --- a/spec/features/projects/labels/user_views_labels_spec.rb +++ b/spec/features/projects/labels/user_views_labels_spec.rb @@ -3,9 +3,8 @@ require "spec_helper" describe "User views labels" do - set(:project) { create(:project_empty_repo, :public) } - set(:user) { create(:user) } - + let_it_be(:project) { create(:project_empty_repo, :public) } + let_it_be(:user) { create(:user) } let(:label_titles) { %w[bug enhancement feature] } let!(:prioritized_label) { create(:label, project: project, title: 'prioritized-label-name', priority: 1) } diff --git a/spec/features/projects/settings/project_settings_spec.rb b/spec/features/projects/settings/project_settings_spec.rb index b601866c96b..9fc91550667 100644 --- a/spec/features/projects/settings/project_settings_spec.rb +++ b/spec/features/projects/settings/project_settings_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Projects settings' do - set(:project) { create(:project) } + let_it_be(:project) { create(:project) } let(:user) { project.owner } let(:panel) { find('.general-settings', match: :first) } let(:button) { panel.find('.btn.js-settings-toggle') } diff --git a/spec/features/projects/show/user_sees_git_instructions_spec.rb b/spec/features/projects/show/user_sees_git_instructions_spec.rb index dde9490a5e1..0c486056329 100644 --- a/spec/features/projects/show/user_sees_git_instructions_spec.rb +++ b/spec/features/projects/show/user_sees_git_instructions_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Projects > Show > User sees Git instructions' do - set(:user) { create(:user) } + let_it_be(:user) { create(:user) } shared_examples_for 'redirects to the sign in page' do it 'redirects to the sign in page' do @@ -49,7 +49,7 @@ describe 'Projects > Show > User sees Git instructions' do context 'when project is public' do context 'when project has no repo' do - set(:project) { create(:project, :public) } + let_it_be(:project) { create(:project, :public) } before do sign_in(project.owner) @@ -60,7 +60,7 @@ describe 'Projects > Show > User sees Git instructions' do end context 'when project is empty' do - set(:project) { create(:project_empty_repo, :public) } + let_it_be(:project) { create(:project_empty_repo, :public) } context 'when not signed in' do before do @@ -98,7 +98,7 @@ describe 'Projects > Show > User sees Git instructions' do end context 'when project is not empty' do - set(:project) { create(:project, :public, :repository) } + let_it_be(:project) { create(:project, :public, :repository) } before do visit(project_path(project)) @@ -141,7 +141,7 @@ describe 'Projects > Show > User sees Git instructions' do end context 'when project is internal' do - set(:project) { create(:project, :internal, :repository) } + let_it_be(:project) { create(:project, :internal, :repository) } context 'when not signed in' do before do @@ -163,7 +163,7 @@ describe 'Projects > Show > User sees Git instructions' do end context 'when project is private' do - set(:project) { create(:project, :private) } + let_it_be(:project) { create(:project, :private) } before do visit(project_path(project)) diff --git a/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb b/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb index cf1a679102c..5aba16597b8 100644 --- a/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb +++ b/spec/features/projects/show/user_sees_last_commit_ci_status_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Projects > Show > User sees last commit CI status' do - set(:project) { create(:project, :repository, :public) } + let_it_be(:project) { create(:project, :repository, :public) } it 'shows the project README', :js do project.enable_ci diff --git a/spec/features/projects/show/user_sees_readme_spec.rb b/spec/features/projects/show/user_sees_readme_spec.rb index 98906de4620..52745b06cd3 100644 --- a/spec/features/projects/show/user_sees_readme_spec.rb +++ b/spec/features/projects/show/user_sees_readme_spec.rb @@ -3,9 +3,8 @@ require 'spec_helper' describe 'Projects > Show > User sees README' do - set(:user) { create(:user) } - - set(:project) { create(:project, :repository, :public) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, :repository, :public) } it 'shows the project README', :js do visit project_path(project) diff --git a/spec/features/projects/user_sees_user_popover_spec.rb b/spec/features/projects/user_sees_user_popover_spec.rb index adbf9073d59..fafb3773866 100644 --- a/spec/features/projects/user_sees_user_popover_spec.rb +++ b/spec/features/projects/user_sees_user_popover_spec.rb @@ -3,8 +3,7 @@ require 'spec_helper' describe 'User sees user popover', :js do - set(:project) { create(:project, :repository) } - + let_it_be(:project) { create(:project, :repository) } let(:user) { project.creator } let(:merge_request) do create(:merge_request, source_project: project, target_project: project) diff --git a/spec/features/projects/wiki/markdown_preview_spec.rb b/spec/features/projects/wiki/markdown_preview_spec.rb index 331ba58d067..7d18c0f7a14 100644 --- a/spec/features/projects/wiki/markdown_preview_spec.rb +++ b/spec/features/projects/wiki/markdown_preview_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Projects > Wiki > User previews markdown changes', :js do - set(:user) { create(:user) } + let_it_be(:user) { create(:user) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) } let(:wiki_content) do diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb index 7503c8aa52e..e67982bbd31 100644 --- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb @@ -3,6 +3,8 @@ require "spec_helper" describe "User creates wiki page" do + include WikiHelpers + let(:user) { create(:user) } let(:wiki) { ProjectWiki.new(project, user) } let(:project) { create(:project) } @@ -14,9 +16,11 @@ describe "User creates wiki page" do end context "when wiki is empty" do - before do + before do |example| visit(project_wikis_path(project)) + wait_for_svg_to_be_loaded(example) + click_link "Create your first page" end @@ -45,7 +49,7 @@ describe "User creates wiki page" do expect(page).to have_content("Create New Page") end - it "shows non-escaped link in the pages list", :quarantine do + it "shows non-escaped link in the pages list" do fill_in(:wiki_title, with: "one/two/three-test") page.within(".wiki-form") do @@ -163,7 +167,7 @@ describe "User creates wiki page" do expect(page).to have_link('Link to Home', href: "/#{project.full_path}/-/wikis/home") end - it_behaves_like 'wiki file attachments', :quarantine + it_behaves_like 'wiki file attachments' end context "in a group namespace", :js do @@ -175,7 +179,7 @@ describe "User creates wiki page" do expect(page).to have_field("wiki[message]", with: "Create home") end - it "creates a page from the home page", :quarantine do + it "creates a page from the home page" do page.within(".wiki-form") do fill_in(:wiki_content, with: "My awesome wiki!") diff --git a/spec/features/projects/wiki/user_views_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_page_spec.rb index c7856342fb2..1a9cde4571e 100644 --- a/spec/features/projects/wiki/user_views_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_page_spec.rb @@ -19,9 +19,12 @@ describe 'User views a wiki page' do sign_in(user) end - context 'when wiki is empty' do + context 'when wiki is empty', :js do before do - visit(project_wikis_path(project)) + visit project_wikis_path(project) + + wait_for_svg_to_be_loaded + click_link "Create your first page" fill_in(:wiki_title, with: 'one/two/three-test') @@ -32,7 +35,7 @@ describe 'User views a wiki page' do end end - it 'shows the history of a page that has a path', :js do + it 'shows the history of a page that has a path' do expect(current_path).to include('one/two/three-test') first(:link, text: 'three').click @@ -45,7 +48,7 @@ describe 'User views a wiki page' do end end - it 'shows an old version of a page', :js do + it 'shows an old version of a page' do expect(current_path).to include('one/two/three-test') expect(find('.wiki-pages')).to have_content('three') @@ -162,9 +165,12 @@ describe 'User views a wiki page' do end it 'opens a default wiki page', :js do - visit(project_path(project)) + visit project_path(project) find('.shortcuts-wiki').click + + wait_for_svg_to_be_loaded + click_link "Create your first page" expect(page).to have_content('Create New Page') |