Commit 5bffed65 authored by Nick Thomas's avatar Nick Thomas

Fix merge conflicts in Ruby specs

parent b3c44d8d
......@@ -161,7 +161,6 @@ describe GroupsController do
expect(assigns(:group).path).not_to eq('new_path')
end
end
<<<<<<< HEAD
describe 'POST create' do
it 'allows creating a group' do
......@@ -203,177 +202,10 @@ describe GroupsController do
end.to change { Group.count }.by(1)
expect(response).to have_http_status(302)
=======
describe '#ensure_canonical_path' do
before do
sign_in(user)
end
context 'for a GET request' do
context 'when requesting groups at the root path' do
before do
allow(request).to receive(:original_fullpath).and_return("/#{group_full_path}")
get :show, id: group_full_path
end
context 'when requesting the canonical path with different casing' do
let(:group_full_path) { group.to_param.upcase }
it 'redirects to the correct casing' do
expect(response).to redirect_to(group)
expect(controller).not_to set_flash[:notice]
end
end
context 'when requesting a redirected path' do
let(:redirect_route) { group.redirect_routes.create(path: 'old-path') }
let(:group_full_path) { redirect_route.path }
it 'redirects to the canonical path' do
expect(response).to redirect_to(group)
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
context 'when the old group path is a substring of the scheme or host' do
let(:redirect_route) { group.redirect_routes.create(path: 'http') }
it 'does not modify the requested host' do
expect(response).to redirect_to(group)
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
context 'when the old group path is substring of groups' do
# I.e. /groups/oups should not become /grfoo/oups
let(:redirect_route) { group.redirect_routes.create(path: 'oups') }
it 'does not modify the /groups part of the path' do
expect(response).to redirect_to(group)
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
end
end
context 'when requesting groups under the /groups path' do
context 'when requesting the canonical path' do
context 'non-show path' do
context 'with exactly matching casing' do
it 'does not redirect' do
get :issues, id: group.to_param
expect(response).not_to have_http_status(301)
end
end
context 'with different casing' do
it 'redirects to the correct casing' do
get :issues, id: group.to_param.upcase
expect(response).to redirect_to(issues_group_path(group.to_param))
expect(controller).not_to set_flash[:notice]
end
end
end
context 'show path' do
context 'with exactly matching casing' do
it 'does not redirect' do
get :show, id: group.to_param
expect(response).not_to have_http_status(301)
end
end
context 'with different casing' do
it 'redirects to the correct casing at the root path' do
get :show, id: group.to_param.upcase
expect(response).to redirect_to(group)
expect(controller).not_to set_flash[:notice]
end
end
end
end
context 'when requesting a redirected path' do
let(:redirect_route) { group.redirect_routes.create(path: 'old-path') }
it 'redirects to the canonical path' do
get :issues, id: redirect_route.path
expect(response).to redirect_to(issues_group_path(group.to_param))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
context 'when the old group path is a substring of the scheme or host' do
let(:redirect_route) { group.redirect_routes.create(path: 'http') }
it 'does not modify the requested host' do
get :issues, id: redirect_route.path
expect(response).to redirect_to(issues_group_path(group.to_param))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
context 'when the old group path is substring of groups' do
# I.e. /groups/oups should not become /grfoo/oups
let(:redirect_route) { group.redirect_routes.create(path: 'oups') }
it 'does not modify the /groups part of the path' do
get :issues, id: redirect_route.path
expect(response).to redirect_to(issues_group_path(group.to_param))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
context 'when the old group path is substring of groups plus the new path' do
# I.e. /groups/oups/oup should not become /grfoos
let(:redirect_route) { group.redirect_routes.create(path: 'oups/oup') }
it 'does not modify the /groups part of the path' do
get :issues, id: redirect_route.path
expect(response).to redirect_to(issues_group_path(group.to_param))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
end
end
end
end
end
context 'for a POST request' do
context 'when requesting the canonical path with different casing' do
it 'does not 404' do
post :update, id: group.to_param.upcase, group: { path: 'new_path' }
expect(response).not_to have_http_status(404)
end
it 'does not redirect to the correct casing' do
post :update, id: group.to_param.upcase, group: { path: 'new_path' }
expect(response).not_to have_http_status(301)
end
end
context 'when requesting a redirected path' do
let(:redirect_route) { group.redirect_routes.create(path: 'old-path') }
it 'returns not found' do
post :update, id: redirect_route.path, group: { path: 'new_path' }
expect(response).to have_http_status(404)
end
>>>>>>> ce/master
end
end
end
<<<<<<< HEAD
describe '#ensure_canonical_path' do
before do
sign_in(user)
......@@ -555,23 +387,6 @@ describe GroupsController do
end
end
=======
context 'for a DELETE request' do
context 'when requesting the canonical path with different casing' do
it 'does not 404' do
delete :destroy, id: group.to_param.upcase
expect(response).not_to have_http_status(404)
end
it 'does not redirect to the correct casing' do
delete :destroy, id: group.to_param.upcase
expect(response).not_to have_http_status(301)
end
end
>>>>>>> ce/master
context 'when requesting a redirected path' do
let(:redirect_route) { group.redirect_routes.create(path: 'old-path') }
......
......@@ -9,13 +9,9 @@ describe Projects::EnvironmentsController do
end
before do
<<<<<<< HEAD
allow_any_instance_of(License).to receive(:feature_available?).and_return(false)
project.team << [user, :master]
=======
project.add_master(user)
>>>>>>> ce/master
sign_in(user)
end
......
......@@ -290,11 +290,7 @@ describe Projects::MergeRequestsController do
recorded = ActiveRecord::QueryRecorder.new { go(format: :json) }
<<<<<<< HEAD
expect(recorded.count).to be_within(5).of(95)
=======
expect(recorded.count).to be_within(5).of(50)
>>>>>>> ce/master
expect(recorded.cached_count).to eq(0)
end
end
......
......@@ -49,10 +49,6 @@ describe Projects::PipelinesController do
expect(json_response['details']).to have_key 'stages'
end
<<<<<<< HEAD
context 'when the pipeline has multiple jobs' do
it 'does not perform N + 1 queries', :with_request_store do
=======
context 'when the pipeline has multiple stages and groups' do
before do
RequestStore.begin!
......@@ -74,7 +70,6 @@ describe Projects::PipelinesController do
end
it 'does not perform N + 1 queries' do
>>>>>>> ce/master
control_count = ActiveRecord::QueryRecorder.new { get_pipeline_json }.count
create_build('test', 1, 'rspec 1')
......
......@@ -168,7 +168,6 @@ describe ProjectsController do
expect(response).to render_template('_files')
end
<<<<<<< HEAD
context 'project repo over limit' do
before do
allow_any_instance_of(Project).to receive(:above_size_limit?).and_return(true)
......@@ -191,8 +190,6 @@ describe ProjectsController do
end
end
=======
>>>>>>> ce/master
context "when the url contains .atom" do
let(:public_project_with_dot_atom) { build(:empty_project, :public, name: 'my.atom', path: 'my.atom') }
......@@ -248,8 +245,6 @@ describe ProjectsController do
expect(assigns(:repository).path).to eq(project.repository.path)
expect(response).to have_http_status(302)
end
<<<<<<< HEAD
=======
end
describe '#transfer' do
......@@ -294,7 +289,6 @@ describe ProjectsController do
expect(flash[:alert]).to eq 'Please select a new namespace for your project.'
end
end
>>>>>>> ce/master
end
describe "#destroy" do
......
......@@ -17,11 +17,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'no lists' do
before do
<<<<<<< HEAD
visit namespace_project_boards_path(project.namespace, project)
=======
visit namespace_project_board_path(project.namespace, project, board)
>>>>>>> ce/master
wait_for_requests
expect(page).to have_selector('.board', count: 2)
end
......@@ -166,11 +162,7 @@ describe 'Issue Boards', feature: true, js: true do
create(:labeled_issue, project: project, labels: [planning])
end
<<<<<<< HEAD
visit namespace_project_boards_path(project.namespace, project)
=======
visit namespace_project_board_path(project.namespace, project, board)
>>>>>>> ce/master
wait_for_requests
page.within(find('.board', match: :first)) do
......@@ -519,11 +511,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'keyboard shortcuts' do
before do
<<<<<<< HEAD
visit namespace_project_boards_path(project.namespace, project)
=======
visit namespace_project_board_path(project.namespace, project, board)
>>>>>>> ce/master
wait_for_requests
end
......@@ -536,11 +524,7 @@ describe 'Issue Boards', feature: true, js: true do
context 'signed out user' do
before do
logout
<<<<<<< HEAD
visit namespace_project_boards_path(project.namespace, project)
=======
visit namespace_project_board_path(project.namespace, project, board)
>>>>>>> ce/master
wait_for_requests
end
......@@ -564,11 +548,7 @@ describe 'Issue Boards', feature: true, js: true do
project.team << [user_guest, :guest]
logout
login_as(user_guest)
<<<<<<< HEAD
visit namespace_project_boards_path(project.namespace, project)
=======
visit namespace_project_board_path(project.namespace, project, board)
>>>>>>> ce/master
wait_for_requests
end
......
......@@ -134,10 +134,6 @@ describe 'Issue Boards', feature: true, js: true do
click_link 'Unassigned'
end
<<<<<<< HEAD
find('.dropdown-menu-toggle').click
=======
>>>>>>> ce/master
wait_for_requests
expect(page).to have_content('No assignee')
......
......@@ -49,11 +49,6 @@ describe "GitLab Flavored Markdown", feature: true do
end
describe "for issues", feature: true, js: true do
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
before do
@other_issue = create(:issue,
author: @user,
......
require 'rails_helper'
describe 'Awards Emoji', feature: true do
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
let!(:project) { create(:project, :public) }
let!(:user) { create(:user) }
let(:issue) do
......
......@@ -180,7 +180,6 @@ describe 'New/edit issue', :feature, :js do
click_link user2.name
end
<<<<<<< HEAD
expect(page.all('input[name="issue[assignee_ids][]"]', visible: false)[0].value).to match(user.id.to_s)
expect(page.all('input[name="issue[assignee_ids][]"]', visible: false)[1].value).to match(user2.id.to_s)
......@@ -188,9 +187,6 @@ describe 'New/edit issue', :feature, :js do
expect(page.all('.dropdown-menu-user a.is-active')[0].first(:xpath, '..')['data-user-id']).to eq(user.id.to_s)
expect(page.all('.dropdown-menu-user a.is-active')[1].first(:xpath, '..')['data-user-id']).to eq(user2.id.to_s)
=======
expect(find('.js-assignee-search')).to have_content(user2.name)
>>>>>>> ce/master
end
end
......
......@@ -721,11 +721,6 @@ describe 'Issues', feature: true do
end
describe 'title issue#show', js: true do
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
it 'updates the title', js: true do
issue = create(:issue, author: @user, assignees: [@user], project: project, title: 'new title')
......
......@@ -37,13 +37,9 @@ feature 'Merge immediately', :feature, :js do
Sidekiq::Testing.fake! do
click_link 'Merge immediately'
wait_for_requests
<<<<<<< HEAD
expect(find('.accept-merge-request.btn-info')).to have_content('Merge in progress')
=======
wait_for_requests
>>>>>>> ce/master
end
end
end
......
......@@ -56,12 +56,8 @@ describe "Compare", js: true do
dropdown.find('.dropdown-menu')
dropdown.fill_in("Filter by Git revision", with: selection)
wait_for_requests
<<<<<<< HEAD
dropdown.find_all("a[data-ref=\"#{selection}\"]", visible: true).last.click
=======
# find before all to wait for the items visiblity
dropdown.find("a[data-ref=\"#{selection}\"]", match: :first)
dropdown.all("a[data-ref=\"#{selection}\"]").last.click
>>>>>>> ce/master
end
end
......@@ -2,10 +2,6 @@ require 'spec_helper'
feature 'Pipeline Schedules', :feature do
include PipelineSchedulesHelper
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
let!(:project) { create(:project) }
let!(:pipeline_schedule) { create(:ci_pipeline_schedule, :nightly, project: project ) }
......
......@@ -64,11 +64,6 @@ feature 'Task Lists', feature: true do
describe 'for Issues', feature: true do
describe 'multiple tasks', js: true do
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
let!(:issue) { create(:issue, description: markdown, author: user, project: project) }
it 'renders' do
......@@ -109,11 +104,6 @@ feature 'Task Lists', feature: true do
end
describe 'single incomplete task', js: true do
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
let!(:issue) { create(:issue, description: singleIncompleteMarkdown, author: user, project: project) }
it 'renders' do
......@@ -133,10 +123,6 @@ feature 'Task Lists', feature: true do
end
describe 'single complete task', js: true do
<<<<<<< HEAD
include WaitForRequests
=======
>>>>>>> ce/master
let!(:issue) { create(:issue, description: singleCompleteMarkdown, author: user, project: project) }
it 'renders' do
......
......@@ -9,10 +9,7 @@
"human_time_estimate": { "type": ["string", "null"] },
"human_total_time_spent": { "type": ["string", "null"] },
"merge_error": { "type": ["string", "null"] },
<<<<<<< HEAD
"rebase_in_progress": { "type": "boolean" },
=======
>>>>>>> ce/master
"assignee_id": { "type": ["integer", "null"] }
},
"additionalProperties": false
......
......@@ -1309,10 +1309,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
context 'with gitaly enabled' do
before { stub_gitaly }
<<<<<<< HEAD
=======
after { Gitlab::GitalyClient.clear_stubs! }
>>>>>>> ce/master
it 'gets the branches from GitalyClient' do
expect_any_instance_of(Gitlab::GitalyClient::Ref).to receive(:local_branches).
......
......@@ -61,11 +61,8 @@ describe Gitlab::UsageData do
pages_domains
protected_branches
releases
<<<<<<< HEAD
remote_mirrors
services
=======
>>>>>>> ce/master
snippets
todos
uploads
......
......@@ -7,7 +7,6 @@ describe ProtectedBranch, models: true do
it { is_expected.to belong_to(:project) }
end
<<<<<<< HEAD
describe "Uniqueness validations" do
[ProtectedBranch::MergeAccessLevel, ProtectedBranch::PushAccessLevel].each do |access_level_class|
let(:user) { create(:user) }
......@@ -107,8 +106,6 @@ describe ProtectedBranch, models: true do
end
end
=======
>>>>>>> ce/master
describe 'Validation' do
it { is_expected.to validate_presence_of(:project) }
it { is_expected.to validate_presence_of(:name) }
......
......@@ -77,18 +77,12 @@ describe Projects::PropagateServiceTemplate, services: true do
stub_const 'Projects::PropagateServiceTemplate::BATCH_SIZE', 3
project_total.times { create(:empty_project) }
<<<<<<< HEAD
expect { described_class.propagate(service_template) }.
to change { Service.all.reload.count }.by(project_total + 1)
=======
described_class.propagate(service_template)
end
it 'creates services for all projects' do
expect(Service.all.reload.count).to eq(project_total + 2)
>>>>>>> ce/master
end
end
......
......@@ -46,7 +46,6 @@ describe ProjectCacheWorker do
worker.perform(project.id, %w(readme))
end
<<<<<<< HEAD
context 'when in Geo secondary node' do
before do
allow(Gitlab::Geo).to receive(:secondary?).and_return(true)
......@@ -60,7 +59,9 @@ describe ProjectCacheWorker do
expect_any_instance_of(Project).not_to receive(:update_commit_count)
subject.perform(project.id)
=======
end
end
context 'with plain readme' do
it 'refreshes the method caches' do
allow(MarkupHelper).to receive(:gitlab_markdown?).and_return(false)
......@@ -70,7 +71,6 @@ describe ProjectCacheWorker do
with(%i(readme)).
and_call_original
worker.perform(project.id, %w(readme))
>>>>>>> ce/master
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment