diff options
author | Robert Speicher <rspeicher@gmail.com> | 2017-07-26 17:52:10 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-07-27 13:12:17 -0400 |
commit | 56ae036e41e3234867a8d6c2b239bbce725425be (patch) | |
tree | 4dece1fb84ede5ab0343d63adf8e0bd352c70d07 | |
parent | 293ad11df400a60faef7ec30dcbdd7575a0be968 (diff) | |
download | gitlab-ce-56ae036e41e3234867a8d6c2b239bbce725425be.tar.gz |
Use `empty_project` where possible in spec/features/merge_requests
29 files changed, 42 insertions, 42 deletions
diff --git a/spec/features/merge_requests/assign_issues_spec.rb b/spec/features/merge_requests/assign_issues_spec.rb index 04c2a694fff..63fa72650ac 100644 --- a/spec/features/merge_requests/assign_issues_spec.rb +++ b/spec/features/merge_requests/assign_issues_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Merge request issue assignment', js: true do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:issue1) { create(:issue, project: project) } let(:issue2) { create(:issue, project: project) } let(:merge_request) { create(:merge_request, :simple, source_project: project, author: user, description: "fixes #{issue1.to_reference} and #{issue2.to_reference}") } diff --git a/spec/features/merge_requests/award_spec.rb b/spec/features/merge_requests/award_spec.rb index 5a12d6f43f3..e886309133d 100644 --- a/spec/features/merge_requests/award_spec.rb +++ b/spec/features/merge_requests/award_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Merge request awards', js: true do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } describe 'logged in' do diff --git a/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb b/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb index c3d7d2fa23f..1f5e7b55fb0 100644 --- a/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb +++ b/spec/features/merge_requests/check_if_mergeable_with_unresolved_discussions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Check if mergeable with unresolved discussions', js: true do let(:user) { create(:user) } - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } let!(:merge_request) { create(:merge_request_with_diff_notes, source_project: project, author: user) } before do diff --git a/spec/features/merge_requests/cherry_pick_spec.rb b/spec/features/merge_requests/cherry_pick_spec.rb index e4c33d57e8d..4b1e1b9a8d4 100644 --- a/spec/features/merge_requests/cherry_pick_spec.rb +++ b/spec/features/merge_requests/cherry_pick_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Cherry-pick Merge Requests', js: true do let(:user) { create(:user) } let(:group) { create(:group) } - let(:project) { create(:project, namespace: group) } + let(:project) { create(:project, :repository, namespace: group) } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user) } before do diff --git a/spec/features/merge_requests/closes_issues_spec.rb b/spec/features/merge_requests/closes_issues_spec.rb index 24000ea75d1..0e97254eada 100644 --- a/spec/features/merge_requests/closes_issues_spec.rb +++ b/spec/features/merge_requests/closes_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Merge Request closing issues message', js: true do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:issue_1) { create(:issue, project: project)} let(:issue_2) { create(:issue, project: project)} let(:merge_request) do diff --git a/spec/features/merge_requests/conflicts_spec.rb b/spec/features/merge_requests/conflicts_spec.rb index 3c5ddf8396d..2c560632a1b 100644 --- a/spec/features/merge_requests/conflicts_spec.rb +++ b/spec/features/merge_requests/conflicts_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Merge request conflict resolution', js: true do let(:user) { create(:user) } - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } before do # In order to have the diffs collapsed, we need to disable the increase feature diff --git a/spec/features/merge_requests/create_new_mr_spec.rb b/spec/features/merge_requests/create_new_mr_spec.rb index 67322bdc8a8..11a74276898 100644 --- a/spec/features/merge_requests/create_new_mr_spec.rb +++ b/spec/features/merge_requests/create_new_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Create New Merge Request', js: true do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } before do project.team << [user, :master] @@ -63,7 +63,7 @@ feature 'Create New Merge Request', js: true do context 'when target project cannot be viewed by the current user' do it 'does not leak the private project name & namespace' do - private_project = create(:project, :private) + private_project = create(:project, :private, :repository) visit project_new_merge_request_path(project, merge_request: { target_project_id: private_project.id }) @@ -74,7 +74,7 @@ feature 'Create New Merge Request', js: true do context 'when source project cannot be viewed by the current user' do it 'does not leak the private project name & namespace' do - private_project = create(:project, :private) + private_project = create(:project, :private, :repository) visit project_new_merge_request_path(project, merge_request: { source_project_id: private_project.id }) diff --git a/spec/features/merge_requests/created_from_fork_spec.rb b/spec/features/merge_requests/created_from_fork_spec.rb index 9b7795ace62..68d793ec9ba 100644 --- a/spec/features/merge_requests/created_from_fork_spec.rb +++ b/spec/features/merge_requests/created_from_fork_spec.rb @@ -2,8 +2,8 @@ require 'spec_helper' feature 'Merge request created from fork' do given(:user) { create(:user) } - given(:project) { create(:project, :public) } - given(:fork_project) { create(:project, :public) } + given(:project) { create(:project, :public, :repository) } + given(:fork_project) { create(:project, :public, :repository) } given!(:merge_request) do create(:forked_project_link, forked_to_project: fork_project, diff --git a/spec/features/merge_requests/diff_notes_avatars_spec.rb b/spec/features/merge_requests/diff_notes_avatars_spec.rb index 7f082f12d47..2d9419d6124 100644 --- a/spec/features/merge_requests/diff_notes_avatars_spec.rb +++ b/spec/features/merge_requests/diff_notes_avatars_spec.rb @@ -4,7 +4,7 @@ feature 'Diff note avatars', js: true do include NoteInteractionHelpers let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") } let(:path) { "files/ruby/popen.rb" } let(:position) do diff --git a/spec/features/merge_requests/diff_notes_resolve_spec.rb b/spec/features/merge_requests/diff_notes_resolve_spec.rb index a2f0b24d6a8..ac7f75bd308 100644 --- a/spec/features/merge_requests/diff_notes_resolve_spec.rb +++ b/spec/features/merge_requests/diff_notes_resolve_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Diff notes resolve', js: true do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") } let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request) } let(:path) { "files/ruby/popen.rb" } diff --git a/spec/features/merge_requests/diffs_spec.rb b/spec/features/merge_requests/diffs_spec.rb index 499cd38e648..201be4b9e40 100644 --- a/spec/features/merge_requests/diffs_spec.rb +++ b/spec/features/merge_requests/diffs_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Diffs URL', js: true do - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } context 'when visit with */* as accept header' do diff --git a/spec/features/merge_requests/edit_mr_spec.rb b/spec/features/merge_requests/edit_mr_spec.rb index 2b0ecfc8c72..7386e78fb13 100644 --- a/spec/features/merge_requests/edit_mr_spec.rb +++ b/spec/features/merge_requests/edit_mr_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Edit Merge Request' do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, :simple, source_project: project) } before do diff --git a/spec/features/merge_requests/filter_by_labels_spec.rb b/spec/features/merge_requests/filter_by_labels_spec.rb index 220e0c8dc68..1d52a4659ad 100644 --- a/spec/features/merge_requests/filter_by_labels_spec.rb +++ b/spec/features/merge_requests/filter_by_labels_spec.rb @@ -1,10 +1,10 @@ require 'rails_helper' -feature 'Issue filtering by Labels', js: true do +feature 'Merge Request filtering by Labels', js: true do include FilteredSearchHelpers include MergeRequestHelpers - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let!(:user) { create(:user) } let!(:label) { create(:label, project: project) } diff --git a/spec/features/merge_requests/filter_by_milestone_spec.rb b/spec/features/merge_requests/filter_by_milestone_spec.rb index f6b9aa733a4..521fcabc881 100644 --- a/spec/features/merge_requests/filter_by_milestone_spec.rb +++ b/spec/features/merge_requests/filter_by_milestone_spec.rb @@ -4,7 +4,7 @@ feature 'Merge Request filtering by Milestone' do include FilteredSearchHelpers include MergeRequestHelpers - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let!(:user) { create(:user)} let(:milestone) { create(:milestone, project: project) } diff --git a/spec/features/merge_requests/filter_merge_requests_spec.rb b/spec/features/merge_requests/filter_merge_requests_spec.rb index 38eb158d06e..f0019be86ad 100644 --- a/spec/features/merge_requests/filter_merge_requests_spec.rb +++ b/spec/features/merge_requests/filter_merge_requests_spec.rb @@ -4,7 +4,7 @@ describe 'Filter merge requests' do include FilteredSearchHelpers include MergeRequestHelpers - let!(:project) { create(:project) } + let!(:project) { create(:project, :repository) } let!(:group) { create(:group) } let!(:user) { create(:user) } let!(:milestone) { create(:milestone, project: project) } diff --git a/spec/features/merge_requests/form_spec.rb b/spec/features/merge_requests/form_spec.rb index e06cd627b20..6ffb05c5030 100644 --- a/spec/features/merge_requests/form_spec.rb +++ b/spec/features/merge_requests/form_spec.rb @@ -1,13 +1,13 @@ require 'rails_helper' describe 'New/edit merge request', :js do - let!(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } - let(:fork_project) { create(:project, forked_from_project: project) } - let!(:user) { create(:user)} - let!(:user2) { create(:user)} - let!(:milestone) { create(:milestone, project: project) } - let!(:label) { create(:label, project: project) } - let!(:label2) { create(:label, project: project) } + let!(:project) { create(:project, :public, :repository) } + let(:fork_project) { create(:project, :repository, forked_from_project: project) } + let!(:user) { create(:user) } + let!(:user2) { create(:user) } + let!(:milestone) { create(:milestone, project: project) } + let!(:label) { create(:label, project: project) } + let!(:label2) { create(:label, project: project) } before do project.team << [user, :master] diff --git a/spec/features/merge_requests/merge_commit_message_toggle_spec.rb b/spec/features/merge_requests/merge_commit_message_toggle_spec.rb index 784f362a28f..429bc277d73 100644 --- a/spec/features/merge_requests/merge_commit_message_toggle_spec.rb +++ b/spec/features/merge_requests/merge_commit_message_toggle_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Clicking toggle commit message link', js: true do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:issue_1) { create(:issue, project: project)} let(:issue_2) { create(:issue, project: project)} let(:merge_request) do diff --git a/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb b/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb index 13142d3b3c9..0b5a595acce 100644 --- a/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb +++ b/spec/features/merge_requests/merge_immediately_with_pipeline_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Merge immediately', :js do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let!(:merge_request) do create(:merge_request_with_diffs, source_project: project, diff --git a/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb b/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb index 9fbdc1b2c80..574f5fe353e 100644 --- a/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb +++ b/spec/features/merge_requests/merge_when_pipeline_succeeds_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'Merge When Pipeline Succeeds', :js do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) do create(:merge_request_with_diffs, source_project: project, diff --git a/spec/features/merge_requests/mini_pipeline_graph_spec.rb b/spec/features/merge_requests/mini_pipeline_graph_spec.rb index ee6e440e70d..b1215f9ba63 100644 --- a/spec/features/merge_requests/mini_pipeline_graph_spec.rb +++ b/spec/features/merge_requests/mini_pipeline_graph_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Mini Pipeline Graph', :js do let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project, head_pipeline: pipeline) } let(:pipeline) { create(:ci_empty_pipeline, project: project, ref: 'master', status: 'running', sha: project.commit.id) } diff --git a/spec/features/merge_requests/reset_filters_spec.rb b/spec/features/merge_requests/reset_filters_spec.rb index 423213709a3..c1b90e5f875 100644 --- a/spec/features/merge_requests/reset_filters_spec.rb +++ b/spec/features/merge_requests/reset_filters_spec.rb @@ -5,7 +5,7 @@ feature 'Merge requests filter clear button', js: true do include MergeRequestHelpers include IssueHelpers - let!(:project) { create(:project, :public) } + let!(:project) { create(:project, :public, :repository) } let!(:user) { create(:user) } let!(:milestone) { create(:milestone, project: project) } let!(:bug) { create(:label, project: project, name: 'bug')} diff --git a/spec/features/merge_requests/toggler_behavior_spec.rb b/spec/features/merge_requests/toggler_behavior_spec.rb index 2283164ca2f..4e5ec9fbd2d 100644 --- a/spec/features/merge_requests/toggler_behavior_spec.rb +++ b/spec/features/merge_requests/toggler_behavior_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' feature 'toggler_behavior', js: true do let(:user) { create(:user) } - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project, author: user) } let(:note) { create(:diff_note_on_merge_request, noteable: merge_request, project: project) } let(:fragment_id) { "#note_#{note.id}" } diff --git a/spec/features/merge_requests/update_merge_requests_spec.rb b/spec/features/merge_requests/update_merge_requests_spec.rb index db2f2b523d2..cf30a687df8 100644 --- a/spec/features/merge_requests/update_merge_requests_spec.rb +++ b/spec/features/merge_requests/update_merge_requests_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' feature 'Multiple merge requests updating from merge_requests#index' do let!(:user) { create(:user)} - let!(:project) { create(:project) } + let!(:project) { create(:project, :repository) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } before do diff --git a/spec/features/merge_requests/user_lists_merge_requests_spec.rb b/spec/features/merge_requests/user_lists_merge_requests_spec.rb index d38d2d57b35..d62b035b40b 100644 --- a/spec/features/merge_requests/user_lists_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_lists_merge_requests_spec.rb @@ -4,7 +4,7 @@ describe 'Projects > Merge requests > User lists merge requests' do include MergeRequestHelpers include SortingHelper - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:user) { create(:user) } before do diff --git a/spec/features/merge_requests/user_posts_notes_spec.rb b/spec/features/merge_requests/user_posts_notes_spec.rb index 35ed08e0a5e..74d21822a59 100644 --- a/spec/features/merge_requests/user_posts_notes_spec.rb +++ b/spec/features/merge_requests/user_posts_notes_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'Merge requests > User posts notes', :js do include NoteInteractionHelpers - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } let(:merge_request) do create(:merge_request, source_project: project, target_project: project) end diff --git a/spec/features/merge_requests/user_sees_system_notes_spec.rb b/spec/features/merge_requests/user_sees_system_notes_spec.rb index 624a425ae52..03dc61c2efa 100644 --- a/spec/features/merge_requests/user_sees_system_notes_spec.rb +++ b/spec/features/merge_requests/user_sees_system_notes_spec.rb @@ -1,8 +1,8 @@ require 'spec_helper' feature 'Merge requests > User sees system notes' do - let(:public_project) { create(:project, :public) } - let(:private_project) { create(:project, :private) } + let(:public_project) { create(:project, :public, :repository) } + let(:private_project) { create(:project, :private, :repository) } let(:issue) { create(:issue, project: private_project) } let(:merge_request) { create(:merge_request, source_project: public_project, source_branch: 'markdown') } let!(:note) { create(:note_on_merge_request, :system, noteable: merge_request, project: public_project, note: "mentioned in #{issue.to_reference(public_project)}") } diff --git a/spec/features/merge_requests/user_uses_slash_commands_spec.rb b/spec/features/merge_requests/user_uses_slash_commands_spec.rb index 881527e1501..43cab65d287 100644 --- a/spec/features/merge_requests/user_uses_slash_commands_spec.rb +++ b/spec/features/merge_requests/user_uses_slash_commands_spec.rb @@ -4,7 +4,7 @@ feature 'Merge Requests > User uses quick actions', js: true do include QuickActionsHelpers let(:user) { create(:user) } - let(:project) { create(:project, :public) } + let(:project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } let!(:milestone) { create(:milestone, project: project, title: 'ASAP') } @@ -129,7 +129,7 @@ feature 'Merge Requests > User uses quick actions', js: true do end describe '/target_branch command in merge request' do - let(:another_project) { create(:project, :public) } + let(:another_project) { create(:project, :public, :repository) } let(:new_url_opts) { { merge_request: { source_branch: 'feature' } } } before do diff --git a/spec/features/merge_requests/widget_spec.rb b/spec/features/merge_requests/widget_spec.rb index 8d7bbf14d86..69e31c7481f 100644 --- a/spec/features/merge_requests/widget_spec.rb +++ b/spec/features/merge_requests/widget_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' describe 'Merge request', :js do let(:user) { create(:user) } - let(:project) { create(:project) } + let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } before do @@ -200,7 +200,7 @@ describe 'Merge request', :js do end context 'user can merge into source project but cannot push to fork', js: true do - let(:fork_project) { create(:project, :public) } + let(:fork_project) { create(:project, :public, :repository) } let(:user2) { create(:user) } before do diff --git a/spec/features/merge_requests/wip_message_spec.rb b/spec/features/merge_requests/wip_message_spec.rb index 5a685056bf3..b422c76249d 100644 --- a/spec/features/merge_requests/wip_message_spec.rb +++ b/spec/features/merge_requests/wip_message_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' feature 'Work In Progress help message' do - let!(:project) { create(:project, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } + let!(:project) { create(:project, :public, :repository) } let!(:user) { create(:user) } before do |