Commit b1b7fa78 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'blackst0ne-convert-specs-rails5-style' into 'master'

[Rails5.1] Update functional specs to use new keyword format

Closes #54062

See merge request gitlab-org/gitlab-ce!23095
parents fca9e0f3 b44a2c80
......@@ -8,7 +8,7 @@ require:
- rubocop-rspec
AllCops:
TargetRailsVersion: 4.2
TargetRailsVersion: 5.0
Exclude:
- 'vendor/**/*'
- 'node_modules/**/*'
......
---
title: "[Rails5.1] Update functional specs to use new keyword format"
merge_request: 23095
author: "@blackst0ne"
type: other
......@@ -19,7 +19,7 @@ describe AbuseReportsController do
user_id = user.id
user.destroy
get :new, { user_id: user_id }
get :new, params: { user_id: user_id }
expect(response).to redirect_to root_path
expect(flash[:alert]).to eq('Cannot create the abuse report. The user has been deleted.')
......@@ -30,7 +30,7 @@ describe AbuseReportsController do
it 'redirects the reporter to the user\'s profile' do
user.block
get :new, { user_id: user.id }
get :new, params: { user_id: user.id }
expect(response).to redirect_to user
expect(flash[:alert]).to eq('Cannot create the abuse report. This user has been blocked.')
......@@ -42,18 +42,18 @@ describe AbuseReportsController do
context 'with valid attributes' do
it 'saves the abuse report' do
expect do
post :create, abuse_report: attrs
post :create, params: { abuse_report: attrs }
end.to change { AbuseReport.count }.by(1)
end
it 'calls notify' do
expect_any_instance_of(AbuseReport).to receive(:notify)
post :create, abuse_report: attrs
post :create, params: { abuse_report: attrs }
end
it 'redirects back to the reported user' do
post :create, abuse_report: attrs
post :create, params: { abuse_report: attrs }
expect(response).to redirect_to user
end
......@@ -62,7 +62,7 @@ describe AbuseReportsController do
context 'with invalid attributes' do
it 'renders new' do
attrs.delete(:user_id)
post :create, abuse_report: attrs
post :create, params: { abuse_report: attrs }
expect(response).to render_template(:new)
end
......
......@@ -52,35 +52,35 @@ describe Admin::ApplicationSettingsController do
end
it 'updates the password_authentication_enabled_for_git setting' do
put :update, application_setting: { password_authentication_enabled_for_git: "0" }
put :update, params: { application_setting: { password_authentication_enabled_for_git: "0" } }
expect(response).to redirect_to(admin_application_settings_path)
expect(ApplicationSetting.current.password_authentication_enabled_for_git).to eq(false)
end
it 'updates the default_project_visibility for string value' do
put :update, application_setting: { default_project_visibility: "20" }
put :update, params: { application_setting: { default_project_visibility: "20" } }
expect(response).to redirect_to(admin_application_settings_path)
expect(ApplicationSetting.current.default_project_visibility).to eq(Gitlab::VisibilityLevel::PUBLIC)
end
it 'update the restricted levels for string values' do
put :update, application_setting: { restricted_visibility_levels: %w[10 20] }
put :update, params: { application_setting: { restricted_visibility_levels: %w[10 20] } }
expect(response).to redirect_to(admin_application_settings_path)
expect(ApplicationSetting.current.restricted_visibility_levels).to eq([10, 20])
end
it 'updates the restricted_visibility_levels when empty array is passed' do
put :update, application_setting: { restricted_visibility_levels: [""] }
put :update, params: { application_setting: { restricted_visibility_levels: [""] } }
expect(response).to redirect_to(admin_application_settings_path)
expect(ApplicationSetting.current.restricted_visibility_levels).to be_empty
end
it 'updates the receive_max_input_size setting' do
put :update, application_setting: { receive_max_input_size: "1024" }
put :update, params: { application_setting: { receive_max_input_size: "1024" } }
expect(response).to redirect_to(admin_application_settings_path)
expect(ApplicationSetting.current.receive_max_input_size).to eq(1024)
......
......@@ -19,7 +19,7 @@ describe Admin::ApplicationsController do
describe 'GET #edit' do
it 'renders the application form' do
get :edit, id: application.id
get :edit, params: { id: application.id }
expect(response).to render_template :edit
expect(assigns[:scopes]).to be_kind_of(Doorkeeper::OAuth::Scopes)
......@@ -31,7 +31,7 @@ describe Admin::ApplicationsController do
create_params = attributes_for(:application, trusted: true)
expect do
post :create, doorkeeper_application: create_params
post :create, params: { doorkeeper_application: create_params }
end.to change { Doorkeeper::Application.count }.by(1)
application = Doorkeeper::Application.last
......@@ -42,7 +42,7 @@ describe Admin::ApplicationsController do
it 'renders the application form on errors' do
expect do
post :create, doorkeeper_application: attributes_for(:application).merge(redirect_uri: nil)
post :create, params: { doorkeeper_application: attributes_for(:application).merge(redirect_uri: nil) }
end.not_to change { Doorkeeper::Application.count }
expect(response).to render_template :new
......@@ -52,7 +52,7 @@ describe Admin::ApplicationsController do
describe 'PATCH #update' do
it 'updates the application' do
patch :update, id: application.id, doorkeeper_application: { redirect_uri: 'http://example.com/', trusted: true }
patch :update, params: { id: application.id, doorkeeper_application: { redirect_uri: 'http://example.com/', trusted: true } }
application.reload
......@@ -61,7 +61,7 @@ describe Admin::ApplicationsController do
end
it 'renders the application form on errors' do
patch :update, id: application.id, doorkeeper_application: { redirect_uri: nil }
patch :update, params: { id: application.id, doorkeeper_application: { redirect_uri: nil } }
expect(response).to render_template :edit
expect(assigns[:scopes]).to be_kind_of(Doorkeeper::OAuth::Scopes)
......
......@@ -12,12 +12,12 @@ describe Admin::GroupsController do
describe 'DELETE #destroy' do
it 'schedules a group destroy' do
Sidekiq::Testing.fake! do
expect { delete :destroy, id: project.group.path }.to change(GroupDestroyWorker.jobs, :size).by(1)
expect { delete :destroy, params: { id: project.group.path } }.to change(GroupDestroyWorker.jobs, :size).by(1)
end
end
it 'redirects to the admin group path' do
delete :destroy, id: project.group.path
delete :destroy, params: { id: project.group.path }
expect(response).to redirect_to(admin_groups_path)
end
......@@ -27,9 +27,11 @@ describe Admin::GroupsController do
let(:group_user) { create(:user) }
it 'adds user to members' do
put :members_update, id: group,
put :members_update, params: {
id: group,
user_ids: group_user.id,
access_level: Gitlab::Access::GUEST
}
expect(response).to set_flash.to 'Users were successfully added.'
expect(response).to redirect_to(admin_group_path(group))
......@@ -37,18 +39,22 @@ describe Admin::GroupsController do
end
it 'can add unlimited members' do
put :members_update, id: group,
put :members_update, params: {
id: group,
user_ids: 1.upto(1000).to_a.join(','),
access_level: Gitlab::Access::GUEST
}
expect(response).to set_flash.to 'Users were successfully added.'
expect(response).to redirect_to(admin_group_path(group))
end
it 'adds no user to members' do
put :members_update, id: group,
put :members_update, params: {
id: group,
user_ids: '',
access_level: Gitlab::Access::GUEST
}
expect(response).to set_flash.to 'No users specified.'
expect(response).to redirect_to(admin_group_path(group))
......
......@@ -20,7 +20,7 @@ describe Admin::HooksController do
merge_requests_events: true
}
post :create, hook: hook_params
post :create, params: { hook: hook_params }
expect(response).to have_gitlab_http_status(302)
expect(SystemHook.all.size).to eq(1)
......
......@@ -13,7 +13,7 @@ describe Admin::IdentitiesController do
it 'repairs ldap blocks' do
expect_any_instance_of(RepairLdapBlockedUserService).to receive(:execute)
put :update, user_id: user.username, id: user.ldap_identity.id, identity: { provider: 'twitter' }
put :update, params: { user_id: user.username, id: user.ldap_identity.id, identity: { provider: 'twitter' } }
end
end
......@@ -23,7 +23,7 @@ describe Admin::IdentitiesController do
it 'repairs ldap blocks' do
expect_any_instance_of(RepairLdapBlockedUserService).to receive(:execute)
delete :destroy, user_id: user.username, id: user.ldap_identity.id
delete :destroy, params: { user_id: user.username, id: user.ldap_identity.id }
end
end
end
......@@ -11,13 +11,13 @@ describe Admin::ProjectsController do
render_views
it 'retrieves the project for the given visibility level' do
get :index, visibility_level: [Gitlab::VisibilityLevel::PUBLIC]
get :index, params: { visibility_level: [Gitlab::VisibilityLevel::PUBLIC] }
expect(response.body).to match(project.name)
end
it 'does not retrieve the project' do
get :index, visibility_level: [Gitlab::VisibilityLevel::INTERNAL]
get :index, params: { visibility_level: [Gitlab::VisibilityLevel::INTERNAL] }
expect(response.body).not_to match(project.name)
end
......@@ -47,7 +47,7 @@ describe Admin::ProjectsController do
render_views
it 'renders show page' do
get :show, namespace_id: project.namespace.path, id: project.path
get :show, params: { namespace_id: project.namespace.path, id: project.path }
expect(response).to have_gitlab_http_status(200)
expect(response.body).to match(project.name)
......
......@@ -17,13 +17,13 @@ describe Admin::RunnersController do
describe '#show' do
it 'shows a particular runner' do
get :show, id: runner.id
get :show, params: { id: runner.id }
expect(response).to have_gitlab_http_status(200)
end
it 'shows 404 for unknown runner' do
get :show, id: 0
get :show, params: { id: 0 }
expect(response).to have_gitlab_http_status(404)
end
......@@ -34,7 +34,7 @@ describe Admin::RunnersController do
new_desc = runner.description.swapcase
expect do
post :update, id: runner.id, runner: { description: new_desc }
post :update, params: { id: runner.id, runner: { description: new_desc } }
end.to change { runner.ensure_runner_queue_value }
runner.reload
......@@ -46,7 +46,7 @@ describe Admin::RunnersController do
describe '#destroy' do
it 'destroys the runner' do
delete :destroy, id: runner.id
delete :destroy, params: { id: runner.id }
expect(response).to have_gitlab_http_status(302)
expect(Ci::Runner.find_by(id: runner.id)).to be_nil
......@@ -58,7 +58,7 @@ describe Admin::RunnersController do
runner.update(active: false)
expect do
post :resume, id: runner.id
post :resume, params: { id: runner.id }
end.to change { runner.ensure_runner_queue_value }
runner.reload
......@@ -73,7 +73,7 @@ describe Admin::RunnersController do
runner.update(active: true)
expect do
post :pause, id: runner.id
post :pause, params: { id: runner.id }
end.to change { runner.ensure_runner_queue_value }
runner.reload
......
......@@ -18,7 +18,7 @@ describe Admin::ServicesController do
end
it 'successfully displays the template' do
get :edit, id: service.id
get :edit, params: { id: service.id }
expect(response).to have_gitlab_http_status(200)
end
......@@ -44,7 +44,7 @@ describe Admin::ServicesController do
it 'calls the propagation worker when service is active' do
expect(PropagateServiceTemplateWorker).to receive(:perform_async).with(service.id)
put :update, id: service.id, service: { active: true }
put :update, params: { id: service.id, service: { active: true } }
expect(response).to have_gitlab_http_status(302)
end
......@@ -52,7 +52,7 @@ describe Admin::ServicesController do
it 'does not call the propagation worker when service is not active' do
expect(PropagateServiceTemplateWorker).not_to receive(:perform_async)
put :update, id: service.id, service: { properties: {} }
put :update, params: { id: service.id, service: { properties: {} } }
expect(response).to have_gitlab_http_status(302)
end
......
......@@ -20,13 +20,13 @@ describe Admin::SpamLogsController do
describe '#destroy' do
it 'removes only the spam log when removing log' do
expect { delete :destroy, id: first_spam.id }.to change { SpamLog.count }.by(-1)
expect { delete :destroy, params: { id: first_spam.id } }.to change { SpamLog.count }.by(-1)
expect(User.find(user.id)).to be_truthy
expect(response).to have_gitlab_http_status(200)
end
it 'removes user and his spam logs when removing the user' do
delete :destroy, id: first_spam.id, remove_user: true
delete :destroy, params: { id: first_spam.id, remove_user: true }
expect(flash[:notice]).to eq "User #{user.username} was successfully removed."
expect(response).to have_gitlab_http_status(302)
......@@ -40,7 +40,7 @@ describe Admin::SpamLogsController do
allow_any_instance_of(AkismetService).to receive(:submit_ham).and_return(true)
end
it 'submits the log as ham' do
post :mark_as_ham, id: first_spam.id
post :mark_as_ham, params: { id: first_spam.id }
expect(response).to have_gitlab_http_status(302)
expect(SpamLog.find(first_spam.id).submitted_as_ham).to be_truthy
......
......@@ -17,7 +17,7 @@ describe Admin::UsersController do
end
it 'deletes user and ghosts their contributions' do
delete :destroy, id: user.username, format: :json
delete :destroy, params: { id: user.username }, format: :json
expect(response).to have_gitlab_http_status(200)
expect(User.exists?(user.id)).to be_falsy
......@@ -25,7 +25,7 @@ describe Admin::UsersController do
end
it 'deletes the user and their contributions when hard delete is specified' do
delete :destroy, id: user.username, hard_delete: true, format: :json
delete :destroy, params: { id: user.username, hard_delete: true }, format: :json
expect(response).to have_gitlab_http_status(200)
expect(User.exists?(user.id)).to be_falsy
......@@ -35,7 +35,7 @@ describe Admin::UsersController do
describe 'PUT block/:id' do
it 'blocks user' do
put :block, id: user.username
put :block, params: { id: user.username }
user.reload
expect(user.blocked?).to be_truthy
expect(flash[:notice]).to eq 'Successfully blocked'
......@@ -51,7 +51,7 @@ describe Admin::UsersController do
end
it 'does not unblock user' do
put :unblock, id: user.username
put :unblock, params: { id: user.username }
user.reload
expect(user.blocked?).to be_truthy
expect(flash[:alert]).to eq 'This user cannot be unlocked manually from GitLab'
......@@ -64,7 +64,7 @@ describe Admin::UsersController do
end
it 'unblocks user' do
put :unblock, id: user.username
put :unblock, params: { id: user.username }
user.reload
expect(user.blocked?).to be_falsey
expect(flash[:notice]).to eq 'Successfully unblocked'
......@@ -79,7 +79,7 @@ describe Admin::UsersController do
end
it 'unlocks user' do
put :unlock, id: user.username
put :unlock, params: { id: user.username }
user.reload
expect(user.access_locked?).to be_falsey
end
......@@ -93,7 +93,7 @@ describe Admin::UsersController do
end
it 'confirms user' do
put :confirm, id: user.username
put :confirm, params: { id: user.username }
user.reload
expect(user.confirmed?).to be_truthy
end
......@@ -121,17 +121,17 @@ describe Admin::UsersController do
end
def go
patch :disable_two_factor, id: user.to_param
patch :disable_two_factor, params: { id: user.to_param }
end
end
describe 'POST create' do
it 'creates the user' do
expect { post :create, user: attributes_for(:user) }.to change { User.count }.by(1)
expect { post :create, params: { user: attributes_for(:user) } }.to change { User.count }.by(1)
end
it 'shows only one error message for an invalid email' do
post :create, user: attributes_for(:user, email: 'bogus')
post :create, params: { user: attributes_for(:user, email: 'bogus') }
expect(assigns[:user].errors).to contain_exactly("Email is invalid")
end
end
......@@ -147,7 +147,7 @@ describe Admin::UsersController do
}
}
post :update, params
post :update, params: params
end
context 'when the admin changes his own password' do
......@@ -227,13 +227,13 @@ describe Admin::UsersController do
end
it "shows a notice" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(flash[:alert]).to eq("You cannot impersonate a blocked user")
end
it "doesn't sign us in as the user" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(warden.user).to eq(admin)
end
......@@ -241,25 +241,25 @@ describe Admin::UsersController do
context "when the user is not blocked" do
it "stores the impersonator in the session" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(session[:impersonator_id]).to eq(admin.id)
end
it "signs us in as the user" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(warden.user).to eq(user)
end
it "redirects to root" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(response).to redirect_to(root_path)
end
it "shows a notice" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(flash[:alert]).to eq("You are now impersonating #{user.username}")
end
......@@ -271,7 +271,7 @@ describe Admin::UsersController do
end
it "shows error page" do
post :impersonate, id: user.username
post :impersonate, params: { id: user.username }
expect(response).to have_gitlab_http_status(404)
end
......
......@@ -522,13 +522,13 @@ describe ApplicationController do
end
it 'renders a 403 when a message is passed to access denied' do
get :index, message: 'None shall pass'
get :index, params: { message: 'None shall pass' }
expect(response).to have_gitlab_http_status(403)
end
it 'renders a status passed to access denied' do
get :index, status: 401
get :index, params: { status: 401 }
expect(response).to have_gitlab_http_status(401)
end
......@@ -548,7 +548,7 @@ describe ApplicationController do
end
context 'html' do
subject { get :index, text: "hi \255" }
subject { get :index, params: { text: "hi \255" } }
it 'renders 412' do
expect { subject }.to raise_error(ActionController::BadRequest)
......@@ -556,7 +556,7 @@ describe ApplicationController do
end
context 'js' do
subject { get :index, text: "hi \255", format: :js }
subject { get :index, format: :js, params: { text: "hi \255" } }
it 'renders 412' do
expect { subject }.to raise_error(ActionController::BadRequest)
......
......@@ -15,7 +15,7 @@ describe AutocompleteController do
describe 'GET #users with project ID' do
before do
get(:users, project_id: project.id)
get(:users, params: { project_id: project.id })
end
it 'returns the project members' do
......@@ -27,7 +27,7 @@ describe AutocompleteController do
describe 'GET #users with unknown project' do
before do
get(:users, project_id: 'unknown')
get(:users, params: { project_id: 'unknown' })
end
it { expect(response).to have_gitlab_http_status(404) }
......@@ -44,7 +44,7 @@ describe AutocompleteController do
describe 'GET #users with group ID' do
before do
get(:users, group_id: group.id)
get(:users, params: { group_id: group.id })
end
it 'returns the group members' do
......@@ -56,7 +56,7 @@ describe AutocompleteController do
describe 'GET #users with unknown group ID' do
before do
get(:users, group_id: 'unknown')
get(:users, params: { group_id: 'unknown' })
end
it { expect(response).to have_gitlab_http_status(404) }
......@@ -72,7 +72,7 @@ describe AutocompleteController do
describe 'GET #users with project ID' do
before do
get(:users, project_id: project.id, current_user: true)
get(:users, params: { project_id: project.id, current_user: true })
end
it 'returns the project members and non-members' do
......@@ -100,7 +100,7 @@ describe AutocompleteController do
user1 = create(:user, username: 'user1', name: 'Ian')
sign_in(user)
get(:users, search: 'user')
get(:users, params: { search: 'user' })
response_usernames = json_response.map { |user| user['username'] }
......@@ -128,7 +128,7 @@ describe AutocompleteController do
describe 'GET #users with public project' do
before do
public_project.add_guest(user)
get(:users, project_id: public_project.id)
get(:users, params: { project_id: public_project.id })
end
it { expect(json_response).to be_kind_of(Array) }
......@@ -137,7 +137,7 @@ describe AutocompleteController do
describe 'GET #users with project' do
before do
get(:users, project_id: project.id)
get(:users, params: { project_id: project.id })
end
it { expect(response).to have_gitlab_http_status(404) }
......@@ -145,7 +145,7 @@ describe AutocompleteController do
describe 'GET #users with unknown project' do
before do
get(:users, project_id: 'unknown')
get(:users, params: { project_id: 'unknown' })
end
it { expect(response).to have_gitlab_http_status(404) }
......@@ -154,7 +154,7 @@ describe AutocompleteController do
describe 'GET #users with inaccessible group' do
before do
project.add_guest(user)
get(:users, group_id: user.namespace.id)
get(:users, params: { group_id: user.namespace.id })
end
it { expect(response).to have_gitlab_http_status(404) }
......@@ -171,7 +171,7 @@ describe AutocompleteController do
describe 'GET #users with todo filter' do
it 'gives an array of users' do
get :users, todo_filter: true
get :users, params: { todo_filter: true }
expect(response.status).to eq 200
expect(json_response).to be_kind_of(Array)
......@@ -186,13 +186,13 @@ describe AutocompleteController do
end
it 'includes the author' do
get(:users, author_id: non_member.id)
get(:users, params: { author_id: non_member.id })
expect(json_response.first["username"]).to eq non_member.username
end
it 'rejects non existent user ids' do
get(:users, author_id: 99999)
get(:users, params: { author_id: 99999 })
expect(json_response.collect { |u| u['id'] }).not_to include(99999)
end
......@@ -200,7 +200,7 @@ describe AutocompleteController do
context 'without authenticating' do
it 'returns empty result' do
get(:users, author_id: non_member.id)
get(:users, params: { author_id: non_member.id })
expect(json_response).to be_empty
end
......@@ -213,7 +213,7 @@ describe AutocompleteController do
end
it 'skips the user IDs passed' do
get(:users, skip_users: [user, user2].map(&:id))
get(:users, params: { skip_users: [user, user2].map(&:id) })
response_user_ids = json_response.map { |user| user['id'] }
......@@ -238,7 +238,7 @@ describe AutocompleteController do
describe 'GET #projects with project ID' do
before do
get(:projects, project_id: project.id)
get(:projects, params: { project_id: project.id })
end
it 'returns projects' do
......@@ -259,7 +259,7 @@ describe AutocompleteController do
describe 'GET #projects with project ID and search' do
before do
get(:projects, project_id: project.id, search: 'rugged')
get(:projects, params: { project_id: project.id, search: 'rugged' })
end
it 'returns projects' do
......@@ -283,7 +283,7 @@ describe AutocompleteController do
describe 'GET #projects with project ID' do
before do
get(:projects, project_id: project.id)
get(:projects, params: { project_id: project.id })
end
it 'returns projects' do
......@@ -305,7 +305,7 @@ describe AutocompleteController do
describe 'GET #projects with project ID and offset_id' do
before do
get(:projects, project_id: project.id, offset_id: authorized_project.id)
get(:projects, params: { project_id: project.id, offset_id: authorized_project.id })
end
it 'returns projects' do
......@@ -324,7 +324,7 @@ describe AutocompleteController do
describe 'GET #projects with project ID' do
before do
get(:projects, project_id: project.id)
get(:projects, params: { project_id: project.id })
end
it 'returns no projects' do
......
......@@ -153,7 +153,7 @@ describe Boards::IssuesController do
params[:project_id] = project
end
get :index, params.compact
get :index, params: params.compact
end
end
......@@ -230,9 +230,11 @@ describe Boards::IssuesController do
def create_issue(user:, board:, list:, title:)
sign_in(user)
post :create, board_id: board.to_param,
post :create, params: {
board_id: board.to_param,
list_id: list.to_param,
issue: { title: title, project_id: project.id },
issue: { title: title, project_id: project.id }
},
format: :json
end
end
......@@ -291,12 +293,14 @@ describe Boards::IssuesController do
def move(user:, board:, issue:, from_list_id:, to_list_id:)
sign_in(user)
patch :update, namespace_id: project.namespace.to_param,
patch :update, params: {
namespace_id: project.namespace.to_param,
project_id: project.id,
board_id: board.to_param,
id: issue.id,
from_list_id: from_list_id,
to_list_id: to_list_id,
to_list_id: to_list_id
},
format: :json
end
end
......
......@@ -46,9 +46,11 @@ describe Boards::ListsController do
def read_board_list(user:, board:)
sign_in(user)
get :index, namespace_id: project.namespace.to_param,
get :index, params: {
namespace_id: project.namespace.to_param,
project_id: project,
board_id: board.to_param,
board_id: board.to_param
},
format: :json
end
end
......@@ -103,10 +105,12 @@ describe Boards::ListsController do
def create_board_list(user:, board:, label_id:)
sign_in(user)
post :create, namespace_id: project.namespace.to_param,
post :create, params: {
namespace_id: project.namespace.to_param,
project_id: project,
board_id: board.to_param,
list: { label_id: label_id },
list: { label_id: label_id }
},
format: :json
end
end
......@@ -201,10 +205,12 @@ describe Boards::ListsController do
def remove_board_list(user:, board:, list:)
sign_in(user)
delete :destroy, namespace_id: project.namespace.to_param,
delete :destroy, params: {
namespace_id: project.namespace.to_param,
project_id: project,
board_id: board.to_param,
id: list.to_param,
id: list.to_param
},
format: :json
end
end
......@@ -245,9 +251,11 @@ describe Boards::ListsController do
def generate_default_lists(user:, board:)
sign_in(user)
post :generate, namespace_id: project.namespace.to_param,
post :generate, params: {
namespace_id: project.namespace.to_param,
project_id: project,
board_id: board.to_param,
board_id: board.to_param
},
format: :json
end
end
......
......@@ -70,7 +70,7 @@ describe ControllerWithCrossProjectAccessCheck do
end
it 'correctly renders an action that does not require cross project access' do
get :show, id: 'nothing'
get :show, params: { id: 'nothing' }
expect(response).to have_gitlab_http_status(200)
end
......@@ -131,13 +131,13 @@ describe ControllerWithCrossProjectAccessCheck do
end
it 'does not skip the check on an action that is not skipped' do
get :show, id: 'hello'
get :show, params: { id: 'hello' }
expect(response).to have_gitlab_http_status(403)
end
it 'does not skip the check on an action that was not defined to skip' do
get :edit, id: 'hello'
get :edit, params: { id: 'hello' }
expect(response).to have_gitlab_http_status(403)
end
......
......@@ -23,7 +23,7 @@ describe GroupTree do
other_group = create(:group, name: 'filter')
other_group.add_owner(user)
get :index, filter: 'filt', format: :json
get :index, params: { filter: 'filt' }, format: :json
expect(assigns(:groups)).to contain_exactly(other_group)
end
......@@ -40,7 +40,7 @@ describe GroupTree do
it 'contains only the subgroup when a parent was given' do
subgroup = create(:group, :public, parent: group)
get :index, parent_id: group.id, format: :json
get :index, params: { parent_id: group.id }, format: :json
expect(assigns(:groups)).to contain_exactly(subgroup)
end
......@@ -48,7 +48,7 @@ describe GroupTree do
it 'allows filtering for subgroups and includes the parents for rendering' do
subgroup = create(:group, :public, parent: group, name: 'filter')
get :index, filter: 'filt', format: :json
get :index, params: { filter: 'filt' }, format: :json
expect(assigns(:groups)).to contain_exactly(group, subgroup)
end
......@@ -59,7 +59,7 @@ describe GroupTree do
subgroup.add_developer(user)
_other_subgroup = create(:group, :private, parent: parent, name: 'filte')
get :index, filter: 'filt', format: :json
get :index, params: { filter: 'filt' }, format: :json
expect(assigns(:groups)).to contain_exactly(parent, subgroup)
end
......@@ -70,7 +70,7 @@ describe GroupTree do
subgroup = create(:group, :public, parent: group)
search_result = create(:group, :public, name: 'result', parent: subgroup)
get :index, filter: 'resu', format: :json
get :index, params: { filter: 'resu' }, format: :json
expect(assigns(:groups)).to contain_exactly(group, subgroup, search_result)
end
......@@ -87,7 +87,7 @@ describe GroupTree do
it 'expands the tree when filtering' do
subgroup = create(:group, :public, parent: group, name: 'filter')
get :index, filter: 'filt', format: :json
get :index, params: { filter: 'filt' }, format: :json
children_response = json_response.first['children']
......
......@@ -34,7 +34,7 @@ describe LfsRequest do
describe '#storage_project' do
it 'assigns the project as storage project' do
get :show, id: project.id
get :show, params: { id: project.id }
expect(assigns(:storage_project)).to eq(project)
end
......@@ -42,7 +42,7 @@ describe LfsRequest do
it 'assigns the source of a forked project' do
forked_project = fork_project(project)
get :show, id: forked_project.id
get :show, params: { id: forked_project.id }
expect(assigns(:storage_project)).to eq(project)
end
......
......@@ -33,7 +33,7 @@ describe Dashboard::GroupsController do
end
it 'renders only groups the user is a member of when searching hierarchy correctly' do
get :index, filter: 'chef', format: :json
get :index, params: { filter: 'chef' }, format: :json
expect(response).to have_gitlab_http_status(200)
all_groups = [top_level_result, top_level_a, sub_level_result_a]
......
......@@ -34,7 +34,7 @@ describe Dashboard::MilestonesController do
render_views
def view_milestone
get :show, id: milestone.safe_title, title: milestone.title
get :show, params: { id: milestone.safe_title, title: milestone.title }
end
it 'shows milestone page' do
......
......@@ -16,19 +16,19 @@ describe Dashboard::TodosController do
it 'renders 404 when user does not have read access on given project' do
unauthorized_project = create(:project, :private)
get :index, project_id: unauthorized_project.id
get :index, params: { project_id: unauthorized_project.id }
expect(response).to have_gitlab_http_status(404)
end
it 'renders 404 when given project does not exists' do
get :index, project_id: 999
get :index, params: { project_id: 999 }
expect(response).to have_gitlab_http_status(404)
end
it 'renders 200 when filtering for "any project" todos' do
get :index, project_id: ''
get :index, params: { project_id: '' }
expect(response).to have_gitlab_http_status(200)
end
......@@ -36,7 +36,7 @@ describe Dashboard::TodosController do
it 'renders 200 when user has access on given project' do
authorized_project = create(:project, :public)
get :index, project_id: authorized_project.id
get :index, params: { project_id: authorized_project.id }
expect(response).to have_gitlab_http_status(200)
end
......@@ -46,7 +46,7 @@ describe Dashboard::TodosController do
it 'renders 404 when user does not have read access on given group' do
unauthorized_group = create(:group, :private)
get :index, group_id: unauthorized_group.id
get :index, params: { group_id: unauthorized_group.id }
expect(response).to have_gitlab_http_status(404)
end
......@@ -62,13 +62,13 @@ describe Dashboard::TodosController do
end
it 'redirects to last_page if page number is larger than number of pages' do
get :index, page: (last_page + 1).to_param
get :index, params: { page: (last_page + 1).to_param }
expect(response).to redirect_to(dashboard_todos_path(page: last_page))
end
it 'goes to the correct page' do
get :index, page: last_page
get :index, params: { page: last_page }
expect(assigns(:todos).current_page).to eq(last_page)
expect(response).to have_gitlab_http_status(200)
......@@ -76,7 +76,7 @@ describe Dashboard::TodosController do
it 'does not redirect to external sites when provided a host field' do
external_host = "www.example.com"
get :index, page: (last_page + 1).to_param, host: external_host
get :index, params: { page: (last_page + 1).to_param, host: external_host }
expect(response).to redirect_to(dashboard_todos_path(page: last_page))
end
......@@ -87,7 +87,7 @@ describe Dashboard::TodosController do
expect(user).to receive(:todos_pending_count).and_call_original
get :index, page: (last_page + 1).to_param, sort: :created_asc
get :index, params: { page: (last_page + 1).to_param, sort: :created_asc }
expect(response).to redirect_to(dashboard_todos_path(page: last_page, sort: :created_asc))
end
......@@ -99,7 +99,7 @@ describe Dashboard::TodosController do
expect(user).not_to receive(:todos_pending_count)
get :index, page: (last_page + 1).to_param, project_id: project.id
get :index, params: { page: (last_page + 1).to_param, project_id: project.id }
expect(response).to redirect_to(dashboard_todos_path(page: last_page, project_id: project.id))
end
......@@ -111,7 +111,7 @@ describe Dashboard::TodosController do
let(:todo) { create(:todo, :done, user: user, project: project, author: author) }
it 'restores the todo to pending state' do
patch :restore, id: todo.id
patch :restore, params: { id: todo.id }
expect(todo.reload).to be_pending
expect(response).to have_gitlab_http_status(200)
......@@ -123,7 +123,7 @@ describe Dashboard::TodosController do
let(:todos) { create_list(:todo, 2, :done, user: user, project: project, author: author) }
it 'restores the todos to pending state' do
patch :bulk_restore, ids: todos.map(&:id)
patch :bulk_restore, params: { ids: todos.map(&:id) }
todos.each do |todo|
expect(todo.reload).to be_pending
......
......@@ -12,13 +12,13 @@ describe Explore::ProjectsController do
end
it 'sorts by last updated' do
get :trending, sort: 'updated_desc'
get :trending, params: { sort: 'updated_desc' }
expect(assigns(:projects)).to eq [project2, project1]
end
it 'sorts by oldest updated' do
get :trending, sort: 'updated_asc'
get :trending, params: { sort: 'updated_asc' }
expect(assigns(:projects)).to eq [project1, project2]
end
......
......@@ -6,7 +6,7 @@ describe GoogleApi::AuthorizationsController do
let(:token) { 'token' }
let(:expires_at) { 1.hour.since.strftime('%s') }
subject { get :callback, code: 'xxx', state: @state }
subject { get :callback, params: { code: 'xxx', state: @state } }
before do
sign_in(user)
......
......@@ -103,7 +103,7 @@ describe GraphqlController do
}
QUERY
post :execute, query: query, operationName: 'Echo', variables: variables, private_token: private_token
post :execute, params: { query: query, operationName: 'Echo', variables: variables, private_token: private_token }
end
def query_response
......
......@@ -10,7 +10,7 @@ describe Groups::AvatarsController do
end
it 'removes avatar from DB calling destroy' do
delete :destroy, group_id: group.path
delete :destroy, params: { group_id: group.path }
@group = assigns(:group)
expect(@group.avatar.present?).to be_falsey
expect(@group).to be_valid
......
......@@ -105,7 +105,7 @@ describe Groups::BoardsController do
end
def list_boards(format: :html)
get :index, group_id: group, format: format
get :index, params: { group_id: group }, format: format
end
end
......@@ -183,8 +183,10 @@ describe Groups::BoardsController do
end
def read_board(board:, format: :html)
get :show, group_id: group,
id: board.to_param,
get :show, params: {
group_id: group,
id: board.to_param
},
format: format
end
end
......
......@@ -16,7 +16,7 @@ describe Groups::ChildrenController do
end
it 'shows all children' do
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_project, private_project)
end
......@@ -26,7 +26,7 @@ describe Groups::ChildrenController do
group_member.destroy!
private_project.add_guest(user)
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_project, private_project)
end
......@@ -35,7 +35,7 @@ describe Groups::ChildrenController do
context 'as a guest' do
it 'shows the public children' do
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_project)
end
......@@ -54,7 +54,7 @@ describe Groups::ChildrenController do
end
it 'shows all children' do
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_subgroup, private_subgroup, public_project, private_project)
end
......@@ -65,7 +65,7 @@ describe Groups::ChildrenController do
private_subgroup.add_guest(user)
private_project.add_guest(user)
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_subgroup, private_subgroup, public_project, private_project)
end
......@@ -74,7 +74,7 @@ describe Groups::ChildrenController do
context 'as a guest' do
it 'shows the public children' do
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
expect(assigns(:children)).to contain_exactly(public_subgroup, public_project)
end
......@@ -84,7 +84,7 @@ describe Groups::ChildrenController do
it 'expands the tree for matching projects' do
project = create(:project, :public, namespace: public_subgroup, name: 'filterme')
get :index, group_id: group.to_param, filter: 'filter', format: :json
get :index, params: { group_id: group.to_param, filter: 'filter' }, format: :json
group_json = json_response.first
project_json = group_json['children'].first
......@@ -96,7 +96,7 @@ describe Groups::ChildrenController do
it 'expands the tree for matching subgroups' do
matched_group = create(:group, :public, parent: public_subgroup, name: 'filterme')
get :index, group_id: group.to_param, filter: 'filter', format: :json
get :index, params: { group_id: group.to_param, filter: 'filter' }, format: :json
group_json = json_response.first
matched_group_json = group_json['children'].first
......@@ -113,7 +113,7 @@ describe Groups::ChildrenController do
l3_subgroup = create(:group, :public, parent: l2_subgroup, path: 'wifi-group')
matched_project_2 = create(:project, :public, namespace: l3_subgroup, name: 'mobile')
get :index, group_id: group.to_param, filter: 'mobile', format: :json
get :index, params: { group_id: group.to_param, filter: 'mobile' }, format: :json
shared_group_json = json_response.first
expect(shared_group_json['id']).to eq(shared_subgroup.id)
......@@ -136,7 +136,7 @@ describe Groups::ChildrenController do
l2_subgroup = create(:group, :public, parent: subgroup)
create(:project, :public, namespace: l2_subgroup, name: 'test')
get :index, group_id: subgroup.to_param, filter: 'test', format: :json
get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json
expect(response).to have_http_status(200)
end
......@@ -144,7 +144,7 @@ describe Groups::ChildrenController do
it 'returns an array with one element when only one result is matched' do
create(:project, :public, namespace: group, name: 'match')
get :index, group_id: group.to_param, filter: 'match', format: :json
get :index, params: { group_id: group.to_param, filter: 'match' }, format: :json
expect(json_response).to be_kind_of(Array)
expect(json_response.size).to eq(1)
......@@ -155,7 +155,7 @@ describe Groups::ChildrenController do
l2_subgroup = create(:group, :public, parent: subgroup)
create(:project, :public, namespace: l2_subgroup, name: 'no-match')
get :index, group_id: subgroup.to_param, filter: 'test', format: :json
get :index, params: { group_id: subgroup.to_param, filter: 'test' }, format: :json
expect(json_response).to eq([])
end
......@@ -179,7 +179,7 @@ describe Groups::ChildrenController do
end
group_to_nest.update!(parent: subgroup)
get :index, group_id: group.to_param, filter: 'filter', per_page: 3, format: :json
get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 3 }, format: :json
expect(response).to have_gitlab_http_status(200)
end
......@@ -187,7 +187,7 @@ describe Groups::ChildrenController do
it 'includes pagination headers' do
2.times { |i| create(:group, :public, parent: public_subgroup, name: "filterme#{i}") }
get :index, group_id: group.to_param, filter: 'filter', per_page: 1, format: :json
get :index, params: { group_id: group.to_param, filter: 'filter', per_page: 1 }, format: :json
expect(response).to include_pagination_headers
end
......@@ -203,7 +203,7 @@ describe Groups::ChildrenController do
let(:expected_queries_per_project) { 0 }
def get_list
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
end
it 'queries the expected amount for a group row' do
......@@ -227,7 +227,7 @@ describe Groups::ChildrenController do
let(:extra_queries_for_hierarchies) { 1 }
def get_filtered_list
get :index, group_id: group.to_param, filter: 'filter', format: :json
get :index, params: { group_id: group.to_param, filter: 'filter' }, format: :json
end
it 'queries the expected amount when nested rows are increased for a group' do
......@@ -276,13 +276,13 @@ describe Groups::ChildrenController do
let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group ) }
it 'has projects on the first page' do
get :index, group_id: group.to_param, sort: 'id_desc', format: :json
get :index, params: { group_id: group.to_param, sort: 'id_desc' }, format: :json
expect(assigns(:children)).to contain_exactly(*first_page_projects)
end
it 'has projects on the second page' do
get :index, group_id: group.to_param, sort: 'id_desc', page: 2, format: :json
get :index, params: { group_id: group.to_param, sort: 'id_desc', page: 2 }, format: :json
expect(assigns(:children)).to contain_exactly(other_project)
end
......@@ -294,13 +294,13 @@ describe Groups::ChildrenController do
let!(:next_page_projects) { create_list(:project, per_page, :public, namespace: group) }
it 'contains all subgroups' do
get :index, group_id: group.to_param, sort: 'id_asc', format: :json
get :index, params: { group_id: group.to_param, sort: 'id_asc' }, format: :json
expect(assigns(:children)).to contain_exactly(*first_page_subgroups)
end
it 'contains the project and group on the second page' do
get :index, group_id: group.to_param, sort: 'id_asc', page: 2, format: :json
get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json
expect(assigns(:children)).to contain_exactly(other_subgroup, *next_page_projects.take(per_page - 1))
end
......@@ -310,7 +310,7 @@ describe Groups::ChildrenController do
let!(:first_page_projects) { create_list(:project, per_page, :public, namespace: group) }
it 'correctly calculates the counts' do
get :index, group_id: group.to_param, sort: 'id_asc', page: 2, format: :json
get :index, params: { group_id: group.to_param, sort: 'id_asc', page: 2 }, format: :json
expect(response).to have_gitlab_http_status(200)
end
......
......@@ -81,7 +81,7 @@ describe Groups::Clusters::ApplicationsController do
end
def go
post :create, params.merge(group_id: group)
post :create, params: params.merge(group_id: group)
end
end
end
......@@ -17,7 +17,7 @@ describe Groups::ClustersController do
describe 'GET index' do
def go(params = {})
get :index, params.reverse_merge(group_id: group)
get :index, params: params.reverse_merge(group_id: group)
end
context 'when feature flag is not enabled' do
......@@ -104,7 +104,7 @@ describe Groups::ClustersController do
describe 'GET new' do
def go
get :new, group_id: group
get :new, params: { group_id: group }
end
describe 'functionality for new cluster' do
......@@ -198,7 +198,7 @@ describe Groups::ClustersController do
end
def go
post :create_gcp, params.merge(group_id: group)
post :create_gcp, params: params.merge(group_id: group)
end
describe 'functionality' do
......@@ -287,7 +287,7 @@ describe Groups::ClustersController do
end
def go
post :create_user, params.merge(group_id: group)
post :create_user, params: params.merge(group_id: group)
end
describe 'functionality' do
......@@ -353,8 +353,10 @@ describe Groups::ClustersController do
def go
get :cluster_status,
params: {
group_id: group.to_param,
id: cluster,
id: cluster
},
format: :json
end
......@@ -390,8 +392,10 @@ describe Groups::ClustersController do
def go
get :show,
params: {
group_id: group,
id: cluster
}
end
describe 'functionality' do
......@@ -417,7 +421,7 @@ describe Groups::ClustersController do
describe 'PUT update' do
def go(format: :html)
put :update, params.merge(
put :update, params: params.merge(
group_id: group.to_param,
id: cluster,
format: format
......@@ -505,8 +509,10 @@ describe Groups::ClustersController do
def go
delete :destroy,
params: {
group_id: group,
id: cluster
}
end
describe 'functionality' do
......
......@@ -6,7 +6,7 @@ describe Groups::GroupMembersController do
describe 'GET index' do
it 'renders index with 200 status code' do
get :index, group_id: group
get :index, params: { group_id: group }
expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:index)
......@@ -26,9 +26,11 @@ describe Groups::GroupMembersController do
end
it 'returns 403' do
post :create, group_id: group,
post :create, params: {
group_id: group,
user_ids: group_user.id,
access_level: Gitlab::Access::GUEST
}
expect(response).to have_gitlab_http_status(403)
expect(group.users).not_to include group_user
......@@ -41,9 +43,11 @@ describe Groups::GroupMembersController do
end
it 'adds user to members' do
post :create, group_id: group,
post :create, params: {
group_id: group,
user_ids: group_user.id,
access_level: Gitlab::Access::GUEST
}
expect(response).to set_flash.to 'Users were successfully added.'
expect(response).to redirect_to(group_group_members_path(group))
......@@ -51,9 +55,11 @@ describe Groups::GroupMembersController do
end
it 'adds no user to members' do
post :create, group_id: group,
post :create, params: {
group_id: group,
user_ids: '',
access_level: Gitlab::Access::GUEST
}
expect(response).to set_flash.to 'No users specified.'
expect(response).to redirect_to(group_group_members_path(group))
......@@ -90,7 +96,7 @@ describe Groups::GroupMembersController do
context 'when member is not found' do
it 'returns 403' do
delete :destroy, group_id: group, id: 42
delete :destroy, params: { group_id: group, id: 42 }
expect(response).to have_gitlab_http_status(403)
end
......@@ -103,7 +109,7 @@ describe Groups::GroupMembersController do
end
it 'returns 403' do
delete :destroy, group_id: group, id: member
delete :destroy, params: { group_id: group, id: member }
expect(response).to have_gitlab_http_status(403)
expect(group.members).to include member
......@@ -116,7 +122,7 @@ describe Groups::GroupMembersController do
end
it '[HTML] removes user from members' do
delete :destroy, group_id: group, id: member
delete :destroy, params: { group_id: group, id: member }
expect(response).to set_flash.to 'User was successfully removed from group.'
expect(response).to redirect_to(group_group_members_path(group))
......@@ -140,7 +146,7 @@ describe Groups::GroupMembersController do
context 'when member is not found' do
it 'returns 404' do
delete :leave, group_id: group
delete :leave, params: { group_id: group }
expect(response).to have_gitlab_http_status(404)
end
......@@ -153,7 +159,7 @@ describe Groups::GroupMembersController do
end
it 'removes user from members' do
delete :leave, group_id: group
delete :leave, params: { group_id: group }
expect(response).to set_flash.to "You left the \"#{group.name}\" group."
expect(response).to redirect_to(dashboard_groups_path)
......@@ -161,7 +167,7 @@ describe Groups::GroupMembersController do
end
it 'supports json request' do
delete :leave, group_id: group, format: :json
delete :leave, params: { group_id: group }, format: :json
expect(response).to have_gitlab_http_status(200)
expect(json_response['notice']).to eq "You left the \"#{group.name}\" group."
......@@ -174,7 +180,7 @@ describe Groups::GroupMembersController do
end
it 'cannot removes himself from the group' do
delete :leave, group_id: group
delete :leave, params: { group_id: group }
expect(response).to have_gitlab_http_status(403)
end
......@@ -186,7 +192,7 @@ describe Groups::GroupMembersController do
end
it 'removes user from members' do
delete :leave, group_id: group
delete :leave, params: { group_id: group }
expect(response).to set_flash.to 'Your access request to the group has been withdrawn.'
expect(response).to redirect_to(group_path(group))
......@@ -203,7 +209,7 @@ describe Groups::GroupMembersController do
end
it 'creates a new GroupMember that is not a team member' do
post :request_access, group_id: group
post :request_access, params: { group_id: group }
expect(response).to set_flash.to 'Your request for access has been queued for review.'
expect(response).to redirect_to(group_path(group))
......@@ -221,7 +227,7 @@ describe Groups::GroupMembersController do
context 'when member is not found' do
it 'returns 403' do
post :approve_access_request, group_id: group, id: 42
post :approve_access_request, params: { group_id: group, id: 42 }
expect(response).to have_gitlab_http_status(403)
end
......@@ -234,7 +240,7 @@ describe Groups::GroupMembersController do
end
it 'returns 403' do
post :approve_access_request, group_id: group, id: member
post :approve_access_request, params: { group_id: group, id: member }
expect(response).to have_gitlab_http_status(403)
expect(group.members).not_to include member
......@@ -247,7 +253,7 @@ describe Groups::GroupMembersController do
end
it 'adds user to members' do
post :approve_access_request, group_id: group, id: member
post :approve_access_request, params: { group_id: group, id: member }
expect(response).to redirect_to(group_group_members_path(group))
expect(group.members).to include member
......
......@@ -16,7 +16,7 @@ describe Groups::LabelsController do
set(:group_label_1) { create(:group_label, group: group, title: 'group_label_1') }
it 'returns group and project labels by default' do
get :index, group_id: group, format: :json
get :index, params: { group_id: group }, format: :json
label_ids = json_response.map {|label| label['title']}
expect(label_ids).to match_array([label_1.title, group_label_1.title])
......@@ -31,7 +31,7 @@ describe Groups::LabelsController do
end
it 'returns ancestor group labels', :nested_groups do
get :index, group_id: subgroup, include_ancestor_groups: true, only_group_labels: true, format: :json
get :index, params: { group_id: subgroup, include_ancestor_groups: true, only_group_labels: true }, format: :json
label_ids = json_response.map {|label| label['title']}
expect(label_ids).to match_array([group_label_1.title, subgroup_label_1.title])
......@@ -43,7 +43,7 @@ describe Groups::LabelsController do
it 'allows user to toggle subscription on group labels' do
label = create(:group_label, group: group)
post :toggle_subscription, group_id: group.to_param, id: label.to_param
post :toggle_subscription, params: { group_id: group.to_param, id: label.to_param }
expect(response).to have_gitlab_http_status(200)
end
......
......@@ -33,7 +33,7 @@ describe Groups::MilestonesController do
describe '#index' do
it 'shows group milestones page' do
get :index, group_id: group.to_param
get :index, params: { group_id: group.to_param }
expect(response).to have_gitlab_http_status(200)
end
......@@ -44,7 +44,7 @@ describe Groups::MilestonesController do
let!(:legacy_milestone2) { create(:milestone, project: project2, title: 'legacy') }
it 'lists legacy group milestones and group milestones' do
get :index, group_id: group.to_param, format: :json
get :index, params: { group_id: group.to_param }, format: :json
milestones = JSON.parse(response.body)
......@@ -67,7 +67,7 @@ describe Groups::MilestonesController do
expect(GlobalMilestone).to receive(:build)
expect(Milestone).not_to receive(:find_by_iid)
get :show, group_id: group.to_param, id: title, title: milestone1.safe_title
get :show, params: { group_id: group.to_param, id: title, title: milestone1.safe_title }
end
end
......@@ -76,7 +76,7 @@ describe Groups::MilestonesController do
expect(GlobalMilestone).not_to receive(:build)
expect(Milestone).to receive(:find_by_iid)
get :show, group_id: group.to_param, id: group_milestone.id
get :show, params: { group_id: group.to_param, id: group_milestone.id }
end
end
end
......@@ -86,8 +86,10 @@ describe Groups::MilestonesController do
describe "#create" do
it "creates group milestone with Chinese title" do
post :create,
params: {
group_id: group.to_param,
milestone: milestone_params
}
milestone = Milestone.find_by_title(title)
......@@ -105,9 +107,11 @@ describe Groups::MilestonesController do
milestone_params[:title] = "title changed"
put :update,
params: {
id: milestone.iid,
group_id: group.to_param,
milestone: milestone_params
}
milestone.reload
expect(response).to redirect_to(group_milestone_path(group, milestone.iid))
......@@ -124,10 +128,12 @@ describe Groups::MilestonesController do
milestone_params[:state_event] = "close"
put :update,
params: {
id: milestone1.title.to_slug.to_s,
group_id: group.to_param,
milestone: milestone_params,
title: milestone1.title
}
expect(response).to redirect_to(group_milestone_path(group, milestone1.safe_title, title: milestone1.title))
......@@ -145,7 +151,7 @@ describe Groups::MilestonesController do
let(:milestone) { create(:milestone, group: group) }
it "removes milestone" do
delete :destroy, group_id: group.to_param, id: milestone.iid, format: :js
delete :destroy, params: { group_id: group.to_param, id: milestone.iid }, format: :js
expect(response).to be_success
expect { Milestone.find(milestone.id) }.to raise_exception(ActiveRecord::RecordNotFound)
......@@ -162,7 +168,7 @@ describe Groups::MilestonesController do
context 'non-show path' do
context 'with exactly matching casing' do
it 'does not redirect' do
get :index, group_id: group.to_param
get :index, params: { group_id: group.to_param }
expect(response).not_to have_gitlab_http_status(301)
end
......@@ -170,7 +176,7 @@ describe Groups::MilestonesController do
context 'with different casing' do
it 'redirects to the correct casing' do
get :index, group_id: group.to_param.upcase
get :index, params: { group_id: group.to_param.upcase }
expect(response).to redirect_to(group_milestones_path(group.to_param))
expect(controller).not_to set_flash[:notice]
......@@ -181,7 +187,7 @@ describe Groups::MilestonesController do
context 'show path' do
context 'with exactly matching casing' do
it 'does not redirect' do
get :show, group_id: group.to_param, id: title
get :show, params: { group_id: group.to_param, id: title }
expect(response).not_to have_gitlab_http_status(301)
end
......@@ -189,7 +195,7 @@ describe Groups::MilestonesController do
context 'with different casing' do
it 'redirects to the correct casing' do
get :show, group_id: group.to_param.upcase, id: title
get :show, params: { group_id: group.to_param.upcase, id: title }
expect(response).to redirect_to(group_milestone_path(group.to_param, title))
expect(controller).not_to set_flash[:notice]
......@@ -202,7 +208,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'old-path') }
it 'redirects to the canonical path' do
get :merge_requests, group_id: redirect_route.path, id: title
get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
......@@ -212,7 +218,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'http') }
it 'does not modify the requested host' do
get :merge_requests, group_id: redirect_route.path, id: title
get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
......@@ -224,7 +230,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'oups') }
it 'does not modify the /groups part of the path' do
get :merge_requests, group_id: redirect_route.path, id: title
get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
......@@ -236,7 +242,7 @@ describe Groups::MilestonesController do
let(:redirect_route) { group.redirect_routes.create(path: 'oups/oup') }
it 'does not modify the /groups part of the path' do
get :merge_requests, group_id: redirect_route.path, id: title
get :merge_requests, params: { group_id: redirect_route.path, id: title }
expect(response).to redirect_to(merge_requests_group_milestone_path(group.to_param, title))
expect(controller).to set_flash[:notice].to(group_moved_message(redirect_route, group))
......@@ -250,16 +256,20 @@ describe Groups::MilestonesController do
context 'when requesting the canonical path with different casing' do
it 'does not 404' do
post :create,
params: {
group_id: group.to_param,
milestone: { title: title }
}
expect(response).not_to have_gitlab_http_status(404)
end
it 'does not redirect to the correct casing' do
post :create,
params: {
group_id: group.to_param,
milestone: { title: title }
}
expect(response).not_to have_gitlab_http_status(301)
end
......@@ -270,8 +280,10 @@ describe Groups::MilestonesController do
it 'returns not found' do
post :create,
params: {
group_id: redirect_route.path,
milestone: { title: title }
}
expect(response).to have_gitlab_http_status(404)
end
......
......@@ -22,7 +22,7 @@ describe Groups::RunnersController do
new_desc = runner.description.swapcase
expect do
post :update, params.merge(runner: { description: new_desc } )
post :update, params: params.merge(runner: { description: new_desc } )
end.to change { runner.ensure_runner_queue_value }
runner.reload
......@@ -34,7 +34,7 @@ describe Groups::RunnersController do
describe '#destroy' do
it 'destroys the runner' do
delete :destroy, params
delete :destroy, params: params
expect(response).to have_gitlab_http_status(302)
expect(Ci::Runner.find_by(id: runner.id)).to be_nil
......@@ -46,7 +46,7 @@ describe Groups::RunnersController do
runner.update(active: false)
expect do
post :resume, params
post :resume, params: params
end.to change { runner.ensure_runner_queue_value }
runner.reload
......@@ -61,7 +61,7 @@ describe Groups::RunnersController do
runner.update(active: true)
expect do
post :pause, params
post :pause, params: params
end.to change { runner.ensure_runner_queue_value }
runner.reload
......
......@@ -11,7 +11,7 @@ describe Groups::Settings::CiCdController do
describe 'GET #show' do
it 'renders show with 200 status code' do
get :show, group_id: group
get :show, params: { group_id: group }
expect(response).to have_gitlab_http_status(200)
expect(response).to render_template(:show)
......@@ -19,7 +19,7 @@ describe Groups::Settings::CiCdController do
end
describe 'PUT #reset_registration_token' do
subject { put :reset_registration_token, group_id: group }
subject { put :reset_registration_token, params: { group_id: group } }
it 'resets runner registration token' do
expect { subject }.to change { group.reload.runners_token }
......
......@@ -2,7 +2,7 @@ require 'spec_helper'
describe Groups::SharedProjectsController do
def get_shared_projects(params = {})
get :index, params.reverse_merge(format: :json, group_id: group.full_path)
get :index, params: params.reverse_merge(format: :json, group_id: group.full_path)
end
def share_project(project)
......
......@@ -15,6 +15,6 @@ describe Groups::UploadsController do
def post_authorize(verified: true)
request.headers.merge!(workhorse_internal_api_request_header) if verified
post :authorize, group_id: model.full_path, format: :json
post :authorize, params: { group_id: model.full_path }, format: :json
end
end
......@@ -13,7 +13,7 @@ describe Groups::VariablesController do
let!(:variable) { create(:ci_group_variable, group: group) }
subject do
get :show, group_id: group, format: :json
get :show, params: { group_id: group }, format: :json
end
include_examples 'GET #show lists all variables'
......@@ -25,8 +25,10 @@ describe Groups::VariablesController do
subject do
patch :update,
params: {
group_id: group,
variables_attributes: variables_attributes,
variables_attributes: variables_attributes
},
format: :json
end
......
This diff is collapsed.
......@@ -37,7 +37,7 @@ describe HealthCheckController do
end
it 'supports passing the token in query params' do
get :index, token: token
get :index, params: { token: token }
expect(response).to be_success
expect(response.content_type).to eq 'text/plain'
......@@ -74,7 +74,7 @@ describe HealthCheckController do
end
it 'supports successful responses for specific checks' do
get :index, checks: 'email', format: :json
get :index, params: { checks: 'email' }, format: :json
expect(response).to be_success
expect(response.content_type).to eq 'application/json'
......@@ -124,7 +124,7 @@ describe HealthCheckController do
end
it 'supports failure responses for specific checks' do
get :index, checks: 'email', format: :json
get :index, params: { checks: 'email' }, format: :json
expect(response).to have_gitlab_http_status(500)
expect(response.content_type).to eq 'application/json'
......
......@@ -18,7 +18,7 @@ describe HealthController do
shared_context 'endpoint responding with readiness data' do
let(:request_params) { {} }
subject { get :readiness, request_params }
subject { get :readiness, params: request_params }
it 'responds with readiness checks data' do
subject
......@@ -112,7 +112,7 @@ describe HealthController do
context 'token passed as URL param' do
it_behaves_like 'endpoint responding with liveness data' do
subject { get :liveness, token: token }
subject { get :liveness, params: { token: token } }
end
end
end
......
......@@ -43,7 +43,7 @@ describe HelpController do
context 'for Markdown formats' do
context 'when requested file exists' do
before do
get :show, path: 'ssh/README', format: :md
get :show, params: { path: 'ssh/README' }, format: :md
end
it 'assigns to @markdown' do
......@@ -58,7 +58,7 @@ describe HelpController do
context 'when requested file is missing' do
it 'renders not found' do
get :show, path: 'foo/bar', format: :md
get :show, params: { path: 'foo/bar' }, format: :md
expect(response).to be_not_found
end
end
......@@ -68,7 +68,9 @@ describe HelpController do
context 'when requested file exists' do
it 'renders the raw file' do
get :show,
path: 'user/project/img/labels_default',
params: {
path: 'user/project/img/labels_default'
},
format: :png
expect(response).to be_success
expect(response.content_type).to eq 'image/png'
......@@ -79,7 +81,9 @@ describe HelpController do
context 'when requested file is missing' do
it 'renders not found' do
get :show,
path: 'foo/bar',
params: {
path: 'foo/bar'
},
format: :png
expect(response).to be_not_found
end
......@@ -89,7 +93,9 @@ describe HelpController do
context 'for other formats' do
it 'always renders not found' do
get :show,
path: 'ssh/README',
params: {
path: 'ssh/README'
},
format: :foo
expect(response).to be_not_found
end
......
......@@ -237,7 +237,7 @@ describe Import::BitbucketController do
.to receive(:new).with(bitbucket_repo, test_name, nested_namespace, user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: nested_namespace.full_path, new_name: test_name, format: :json }
post :create, params: { target_namespace: nested_namespace.full_path, new_name: test_name }, format: :json
end
end
......@@ -249,7 +249,7 @@ describe Import::BitbucketController do
.to receive(:new).with(bitbucket_repo, test_name, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: 'foo/bar', new_name: test_name, format: :json }
post :create, params: { target_namespace: 'foo/bar', new_name: test_name }, format: :json
end
it 'creates the namespaces' do
......@@ -257,7 +257,7 @@ describe Import::BitbucketController do
.to receive(:new).with(bitbucket_repo, test_name, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
expect { post :create, { target_namespace: 'foo/bar', new_name: test_name, format: :json } }
expect { post :create, params: { target_namespace: 'foo/bar', new_name: test_name }, format: :json }
.to change { Namespace.count }.by(2)
end
......@@ -266,7 +266,7 @@ describe Import::BitbucketController do
.to receive(:new).with(bitbucket_repo, test_name, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: 'foo/bar', new_name: test_name, format: :json }
post :create, params: { target_namespace: 'foo/bar', new_name: test_name }, format: :json
expect(Namespace.find_by_path_or_name('bar').parent.path).to eq('foo')
end
......@@ -285,7 +285,7 @@ describe Import::BitbucketController do
.to receive(:new).with(bitbucket_repo, test_name, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: 'foo/foobar/bar', new_name: test_name, format: :json }
post :create, params: { target_namespace: 'foo/foobar/bar', new_name: test_name }, format: :json
end
it 'creates the namespaces' do
......@@ -293,7 +293,7 @@ describe Import::BitbucketController do
.to receive(:new).with(bitbucket_repo, test_name, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
expect { post :create, { target_namespace: 'foo/foobar/bar', new_name: test_name, format: :json } }
expect { post :create, params: { target_namespace: 'foo/foobar/bar', new_name: test_name }, format: :json }
.to change { Namespace.count }.by(2)
end
end
......@@ -302,7 +302,7 @@ describe Import::BitbucketController do
it 'returns 422 response' do
other_namespace = create(:group, name: 'other_namespace')
post :create, { target_namespace: other_namespace.name, format: :json }
post :create, params: { target_namespace: other_namespace.name }, format: :json
expect(response).to have_gitlab_http_status(422)
end
......
......@@ -42,19 +42,19 @@ describe Import::BitbucketServerController do
.to receive(:new).with(project_key, repo_slug, anything, 'my-project', user.namespace, user, anything)
.and_return(double(execute: project))
post :create, project: project_key, repository: repo_slug, format: :json
post :create, params: { project: project_key, repository: repo_slug }, format: :json
expect(response).to have_gitlab_http_status(200)
end
it 'returns an error when an invalid project key is used' do
post :create, project: 'some&project'
post :create, params: { project: 'some&project' }
expect(response).to have_gitlab_http_status(422)
end
it 'returns an error when an invalid repository slug is used' do
post :create, project: 'some-project', repository: 'try*this'
post :create, params: { project: 'some-project', repository: 'try*this' }
expect(response).to have_gitlab_http_status(422)
end
......@@ -62,7 +62,7 @@ describe Import::BitbucketServerController do
it 'returns an error when the project cannot be found' do
allow(client).to receive(:repo).with(project_key, repo_slug).and_return(nil)
post :create, project: project_key, repository: repo_slug, format: :json
post :create, params: { project: project_key, repository: repo_slug }, format: :json
expect(response).to have_gitlab_http_status(422)
end
......@@ -72,7 +72,7 @@ describe Import::BitbucketServerController do
.to receive(:new).with(project_key, repo_slug, anything, 'my-project', user.namespace, user, anything)
.and_return(double(execute: build(:project)))
post :create, project: project_key, repository: repo_slug, format: :json
post :create, params: { project: project_key, repository: repo_slug }, format: :json
expect(response).to have_gitlab_http_status(422)
end
......@@ -80,7 +80,7 @@ describe Import::BitbucketServerController do
it "returns an error when the server can't be contacted" do
expect(client).to receive(:repo).with(project_key, repo_slug).and_raise(BitbucketServer::Client::ServerError)
post :create, project: project_key, repository: repo_slug, format: :json
post :create, params: { project: project_key, repository: repo_slug }, format: :json
expect(response).to have_gitlab_http_status(422)
end
......@@ -103,7 +103,7 @@ describe Import::BitbucketServerController do
end
it 'sets the session variables' do
post :configure, personal_access_token: token, bitbucket_username: username, bitbucket_server_url: url
post :configure, params: { personal_access_token: token, bitbucket_username: username, bitbucket_server_url: url }
expect(session[:bitbucket_server_url]).to eq(url)
expect(session[:bitbucket_server_username]).to eq(username)
......
......@@ -209,7 +209,7 @@ describe Import::GitlabController do
.to receive(:new).with(gitlab_repo, nested_namespace, user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: nested_namespace.full_path, format: :json }
post :create, params: { target_namespace: nested_namespace.full_path }, format: :json
end
end
......@@ -221,7 +221,7 @@ describe Import::GitlabController do
.to receive(:new).with(gitlab_repo, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: 'foo/bar', format: :json }
post :create, params: { target_namespace: 'foo/bar' }, format: :json
end
it 'creates the namespaces' do
......@@ -229,7 +229,7 @@ describe Import::GitlabController do
.to receive(:new).with(gitlab_repo, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
expect { post :create, { target_namespace: 'foo/bar', format: :json } }
expect { post :create, params: { target_namespace: 'foo/bar' }, format: :json }
.to change { Namespace.count }.by(2)
end
......@@ -238,7 +238,7 @@ describe Import::GitlabController do
.to receive(:new).with(gitlab_repo, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: 'foo/bar', format: :json }
post :create, params: { target_namespace: 'foo/bar' }, format: :json
expect(Namespace.find_by_path_or_name('bar').parent.path).to eq('foo')
end
......@@ -257,7 +257,7 @@ describe Import::GitlabController do
.to receive(:new).with(gitlab_repo, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
post :create, { target_namespace: 'foo/foobar/bar', format: :json }
post :create, params: { target_namespace: 'foo/foobar/bar' }, format: :json
end
it 'creates the namespaces' do
......@@ -265,7 +265,7 @@ describe Import::GitlabController do
.to receive(:new).with(gitlab_repo, kind_of(Namespace), user, access_params)
.and_return(double(execute: project))
expect { post :create, { target_namespace: 'foo/foobar/bar', format: :json } }
expect { post :create, params: { target_namespace: 'foo/foobar/bar' }, format: :json }
.to change { Namespace.count }.by(2)
end
end
......@@ -274,7 +274,7 @@ describe Import::GitlabController do
it 'returns 422 response' do
other_namespace = create(:group, name: 'other_namespace')
post :create, { target_namespace: other_namespace.name, format: :json }
post :create, params: { target_namespace: other_namespace.name }, format: :json
expect(response).to have_gitlab_http_status(422)
end
......
......@@ -12,14 +12,14 @@ describe Import::GitlabProjectsController do
describe 'POST create' do
context 'with an invalid path' do
it 'redirects with an error' do
post :create, namespace_id: namespace.id, path: '/test', file: file
post :create, params: { namespace_id: namespace.id, path: '/test', file: file }
expect(flash[:alert]).to start_with('Project could not be imported')
expect(response).to have_gitlab_http_status(302)
end
it 'redirects with an error when a relative path is used' do
post :create, namespace_id: namespace.id, path: '../test', file: file
post :create, params: { namespace_id: namespace.id, path: '../test', file: file }
expect(flash[:alert]).to start_with('Project could not be imported')
expect(response).to have_gitlab_http_status(302)
......@@ -28,7 +28,7 @@ describe Import::GitlabProjectsController do
context 'with a valid path' do
it 'redirects to the new project path' do
post :create, namespace_id: namespace.id, path: 'test', file: file
post :create, params: { namespace_id: namespace.id, path: 'test', file: file }
expect(flash[:notice]).to include('is being imported')
expect(response).to have_gitlab_http_status(302)
......
......@@ -12,7 +12,7 @@ describe Import::GoogleCodeController do
describe "POST callback" do
it "stores Google Takeout dump list in session" do
post :callback, dump_file: dump_file
post :callback, params: { dump_file: dump_file }
expect(session[:google_code_dump]).to be_a(Hash)
expect(session[:google_code_dump]["kind"]).to eq("projecthosting#user")
......
......@@ -12,7 +12,7 @@ describe InvitesController do
describe 'GET #accept' do
it 'accepts user' do
get :accept, id: token
get :accept, params: { id: token }
member.reload
expect(response).to have_gitlab_http_status(302)
......@@ -23,7 +23,7 @@ describe InvitesController do
describe 'GET #decline' do
it 'declines user' do
get :decline, id: token
get :decline, params: { id: token }
expect {member.reload}.to raise_error ActiveRecord::RecordNotFound
expect(response).to have_gitlab_http_status(302)
......
......@@ -11,7 +11,7 @@ describe Ldap::OmniauthCallbacksController do
it 'respects remember me checkbox' do
expect do
post provider, remember_me: '1'
post provider, params: { remember_me: '1' }
end.to change { user.reload.remember_created_at }.from(nil)
end
......@@ -19,7 +19,7 @@ describe Ldap::OmniauthCallbacksController do
let(:user) { create(:omniauth_user, :two_factor_via_otp, extern_uid: uid, provider: provider) }
it 'passes remember_me to the Devise view' do
post provider, remember_me: '1'
post provider, params: { remember_me: '1' }
expect(assigns[:user].remember_me).to eq '1'
end
......
......@@ -13,8 +13,10 @@ describe NotificationSettingsController do
context 'when not authorized' do
it 'redirects to sign in page' do
post :create,
params: {
project_id: project.id,
notification_setting: { level: :participating }
}
expect(response).to redirect_to(new_user_session_path)
end
......@@ -41,8 +43,10 @@ describe NotificationSettingsController do
it 'creates notification setting' do
post :create,
params: {
project_id: project.id,
notification_setting: { level: :participating }
}
expect(response.status).to eq 200
expect(notification_setting.level).to eq("participating")
......@@ -54,8 +58,10 @@ describe NotificationSettingsController do
context 'with custom settings' do
it 'creates notification setting' do
post :create,
params: {
project_id: project.id,
notification_setting: { level: :custom }.merge(custom_events)
}
expect(response.status).to eq 200
expect(notification_setting.level).to eq("custom")
......@@ -72,8 +78,10 @@ describe NotificationSettingsController do
it 'creates notification setting' do
post :create,
params: {
namespace_id: group.id,
notification_setting: { level: :watch }
}
expect(response.status).to eq 200
expect(notification_setting.level).to eq("watch")
......@@ -85,8 +93,10 @@ describe NotificationSettingsController do
context 'with custom settings' do
it 'creates notification setting' do
post :create,
params: {
namespace_id: group.id,
notification_setting: { level: :custom }.merge(custom_events)
}
expect(response.status).to eq 200
expect(notification_setting.level).to eq("custom")
......@@ -108,8 +118,10 @@ describe NotificationSettingsController do
it 'returns 404' do
post :create,
params: {
project_id: private_project.id,
notification_setting: { level: :participating }
}
expect(response).to have_gitlab_http_status(404)
end
......@@ -122,8 +134,10 @@ describe NotificationSettingsController do
context 'when not authorized' do
it 'redirects to sign in page' do
put :update,
params: {
id: notification_setting,
notification_setting: { level: :participating }
}
expect(response).to redirect_to(new_user_session_path)
end
......@@ -136,8 +150,10 @@ describe NotificationSettingsController do
it 'returns success' do
put :update,
params: {
id: notification_setting,
notification_setting: { level: :participating }
}
expect(response.status).to eq 200
end
......@@ -153,8 +169,10 @@ describe NotificationSettingsController do
it 'returns success' do
put :update,
params: {
id: notification_setting,
notification_setting: { level: :participating, events: custom_events }
}
expect(response.status).to eq 200
end
......@@ -170,8 +188,10 @@ describe NotificationSettingsController do
it 'returns 404' do
put :update,
params: {
id: notification_setting,
notification_setting: { level: :participating }
}
expect(response).to have_gitlab_http_status(404)
end
......
......@@ -26,7 +26,7 @@ describe Oauth::ApplicationsController do
describe 'POST #create' do
it 'creates an application' do
post :create, oauth_params
post :create, params: oauth_params
expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to(oauth_application_path(Doorkeeper::Application.last))
......@@ -35,7 +35,7 @@ describe Oauth::ApplicationsController do
it 'redirects back to profile page if OAuth applications are disabled' do
disable_user_oauth
post :create, oauth_params
post :create, params: oauth_params
expect(response).to have_gitlab_http_status(302)
expect(response).to redirect_to(profile_path)
......@@ -52,7 +52,7 @@ describe Oauth::ApplicationsController do
}
}
post :create, invalid_uri_params
post :create, params: invalid_uri_params
expect(response.body).to include 'Redirect URI is forbidden by the server'
end
......
......@@ -30,7 +30,7 @@ describe Oauth::AuthorizationsController do
render_views
it 'returns 200 code and renders view' do
get :new, params
get :new, params: params
expect(response).to have_gitlab_http_status(200)
expect(response).to render_template('doorkeeper/authorizations/new')
......@@ -40,7 +40,7 @@ describe Oauth::AuthorizationsController do
application.update(trusted: true)
request.session['user_return_to'] = 'http://example.com'
get :new, params
get :new, params: params
expect(request.session['user_return_to']).to be_nil
expect(response).to have_gitlab_http_status(302)
......@@ -57,7 +57,7 @@ describe Oauth::AuthorizationsController do
end
it 'authorizes the request and redirects' do
get :new, params
get :new, params: params
expect(request.session['user_return_to']).to be_nil
expect(response).to have_gitlab_http_status(302)
......
......@@ -22,7 +22,7 @@ describe PasswordsController do
let(:user) { create(:omniauth_user, provider: 'ldapmain', email: 'ldapuser@gitlab.com') }
it 'prevents a password reset' do
post :create, user: { email: user.email }
post :create, params: { user: { email: user.email } }
expect(flash[:alert]).to eq 'Password authentication is unavailable.'
end
......
......@@ -9,7 +9,7 @@ describe Profiles::AccountsController do
end
it 'renders 404 if someone tries to unlink a non existent provider' do
delete :unlink, provider: 'github'
delete :unlink, params: { provider: 'github' }
expect(response).to have_gitlab_http_status(404)
end
......@@ -21,7 +21,7 @@ describe Profiles::AccountsController do
it "does not allow to unlink connected account" do
identity = user.identities.last
delete :unlink, provider: provider.to_s
delete :unlink, params: { provider: provider.to_s }
expect(response).to have_gitlab_http_status(302)
expect(user.reload.identities).to include(identity)
......@@ -36,7 +36,7 @@ describe Profiles::AccountsController do
it 'allows to unlink connected account' do
identity = user.identities.last
delete :unlink, provider: provider.to_s
delete :unlink, params: { provider: provider.to_s }
expect(response).to have_gitlab_http_status(302)
expect(user.reload.identities).not_to include(identity)
......
......@@ -11,7 +11,7 @@ describe Profiles::EmailsController do
let(:email_params) { { email: "add_email@example.com" } }
it 'sends an email confirmation' do
expect { post(:create, { email: email_params }) }.to change { ActionMailer::Base.deliveries.size }
expect { post(:create, params: { email: email_params }) }.to change { ActionMailer::Base.deliveries.size }
expect(ActionMailer::Base.deliveries.last.to).to eq [email_params[:email]]
expect(ActionMailer::Base.deliveries.last.subject).to match "Confirmation instructions"
end
......@@ -23,13 +23,13 @@ describe Profiles::EmailsController do
it 'resends an email confirmation' do
email = user.emails.create(email: 'add_email@example.com')
expect { put(:resend_confirmation_instructions, { id: email }) }.to change { ActionMailer::Base.deliveries.size }
expect { put(:resend_confirmation_instructions, params: { id: email }) }.to change { ActionMailer::Base.deliveries.size }
expect(ActionMailer::Base.deliveries.last.to).to eq [email_params[:email]]
expect(ActionMailer::Base.deliveries.last.subject).to match "Confirmation instructions"
end
it 'unable to resend an email confirmation' do
expect { put(:resend_confirmation_instructions, { id: 1 }) }.not_to change { ActionMailer::Base.deliveries.size }
expect { put(:resend_confirmation_instructions, params: { id: 1 }) }.not_to change { ActionMailer::Base.deliveries.size }
end
end
end
......@@ -6,7 +6,7 @@ describe Profiles::KeysController do
describe "#get_keys" do
describe "non existent user" do
it "does not generally work" do
get :get_keys, username: 'not-existent'
get :get_keys, params: { username: 'not-existent' }
expect(response).not_to be_success
end
......@@ -14,19 +14,19 @@ describe Profiles::KeysController do
describe "user with no keys" do
it "does generally work" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response).to be_success
end
it "renders all keys separated with a new line" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response.body).to eq("")
end
it "responds with text/plain content type" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response.content_type).to eq("text/plain")
end
end
......@@ -37,13 +37,13 @@ describe Profiles::KeysController do
let!(:deploy_key) { create(:deploy_key, user: user) }
it "does generally work" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response).to be_success
end
it "renders all non deploy keys separated with a new line" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response.body).not_to eq('')
expect(response.body).to eq(user.all_ssh_keys.join("\n"))
......@@ -55,13 +55,13 @@ describe Profiles::KeysController do
end
it "does not render the comment of the key" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response.body).not_to match(/dummy@gitlab.com/)
end
it "responds with text/plain content type" do
get :get_keys, username: user.username
get :get_keys, params: { username: user.username }
expect(response.content_type).to eq("text/plain")
end
......
......@@ -24,7 +24,7 @@ describe Profiles::NotificationsController do
it 'updates only permitted attributes' do
sign_in(user)
put :update, user: { notification_email: 'new@example.com', notified_of_own_activity: true, admin: true }
put :update, params: { user: { notification_email: 'new@example.com', notified_of_own_activity: true, admin: true } }
user.reload
expect(user.notification_email).to eq('new@example.com')
......@@ -36,7 +36,7 @@ describe Profiles::NotificationsController do
it 'shows an error message if the params are invalid' do
sign_in(user)
put :update, user: { notification_email: '' }
put :update, params: { user: { notification_email: '' } }
expect(user.reload.notification_email).to eq('original@example.com')
expect(controller).to set_flash[:alert].to('Failed to save new settings')
......
......@@ -17,7 +17,7 @@ describe Profiles::PersonalAccessTokensController do
name = 'My PAT'
scopes = %w[api read_user]
post :create, personal_access_token: token_attributes.merge(scopes: scopes, name: name)
post :create, params: { personal_access_token: token_attributes.merge(scopes: scopes, name: name) }
expect(created_token).not_to be_nil
expect(created_token.name).to eq(name)
......@@ -28,7 +28,7 @@ describe Profiles::PersonalAccessTokensController do
it "allows creation of a token with an expiry date" do
expires_at = 5.days.from_now.to_date
post :create, personal_access_token: token_attributes.merge(expires_at: expires_at)
post :create, params: { personal_access_token: token_attributes.merge(expires_at: expires_at) }
expect(created_token).not_to be_nil
expect(created_token.expires_at).to eq(expires_at)
......
......@@ -29,7 +29,7 @@ describe Profiles::PreferencesController do
theme_id: '1'
)
patch :update, user: params, format: format
patch :update, params: { user: params }, format: format
end
context 'on successful update' do
......
......@@ -32,7 +32,7 @@ describe Profiles::TwoFactorAuthsController do
let(:pin) { 'pin-code' }
def go
post :create, pin_code: pin
post :create, params: { pin_code: pin }
end
context 'with valid pin' do
......
......@@ -9,7 +9,7 @@ describe ProfilesController, :request_store do
expect do
post :update,
user: { password: 'hello12345', password_confirmation: 'hello12345' }
params: { user: { password: 'hello12345', password_confirmation: 'hello12345' } }
end.not_to change { user.reload.encrypted_password }
expect(response.status).to eq(302)
......@@ -21,7 +21,7 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update,
user: { email: "john@gmail.com", name: "John" }
params: { user: { email: "john@gmail.com", name: "John" } }
user.reload
......@@ -35,7 +35,7 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update,
user: { email: "john@gmail.com", name: "John" }
params: { user: { email: "john@gmail.com", name: "John" } }
user.reload
......@@ -52,7 +52,7 @@ describe ProfilesController, :request_store do
sign_in(ldap_user)
put :update,
user: { email: "john@gmail.com", name: "John" }
params: { user: { email: "john@gmail.com", name: "John" } }
ldap_user.reload
......@@ -69,7 +69,7 @@ describe ProfilesController, :request_store do
sign_in(ldap_user)
put :update,
user: { email: "john@gmail.com", name: "John", location: "City, Country" }
params: { user: { email: "john@gmail.com", name: "John", location: "City, Country" } }
ldap_user.reload
......@@ -82,7 +82,7 @@ describe ProfilesController, :request_store do
it 'allows setting a user status' do
sign_in(user)
put :update, user: { status: { message: 'Working hard!' } }
put :update, params: { user: { status: { message: 'Working hard!' } } }
expect(user.reload.status.message).to eq('Working hard!')
expect(response).to have_gitlab_http_status(302)
......@@ -98,7 +98,7 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update_username,
user: { username: new_username }
params: { user: { username: new_username } }
user.reload
......@@ -110,7 +110,9 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update_username,
user: { username: new_username },
params: {
user: { username: new_username }
},
format: :json
expect(response.status).to eq(200)
......@@ -121,7 +123,9 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update_username,
user: { username: 'invalid username.git' },
params: {
user: { username: 'invalid username.git' }
},
format: :json
expect(response.status).to eq(422)
......@@ -131,7 +135,7 @@ describe ProfilesController, :request_store do
it 'raises a correct error when the username is missing' do
sign_in(user)
expect { put :update_username, user: { gandalf: 'you shall not pass' } }
expect { put :update_username, params: { user: { gandalf: 'you shall not pass' } } }
.to raise_error(ActionController::ParameterMissing)
end
......@@ -142,7 +146,7 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update_username,
user: { username: new_username }
params: { user: { username: new_username } }
user.reload
......@@ -160,7 +164,7 @@ describe ProfilesController, :request_store do
sign_in(user)
put :update_username,
user: { username: new_username }
params: { user: { username: new_username } }
user.reload
......
......@@ -22,7 +22,7 @@ describe Projects::ArtifactsController do
def download_artifact(extra_params = {})
params = { namespace_id: project.namespace, project_id: project, job_id: job }.merge(extra_params)
get :download, params
get :download, params: params
end
context 'when no file type is supplied' do
......@@ -86,7 +86,7 @@ describe Projects::ArtifactsController do
describe 'GET browse' do
context 'when the directory exists' do
it 'renders the browse view' do
get :browse, namespace_id: project.namespace, project_id: project, job_id: job, path: 'other_artifacts_0.1.2'
get :browse, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: 'other_artifacts_0.1.2' }
expect(response).to render_template('projects/artifacts/browse')
end
......@@ -94,7 +94,7 @@ describe Projects::ArtifactsController do
context 'when the directory does not exist' do
it 'responds Not Found' do
get :browse, namespace_id: project.namespace, project_id: project, job_id: job, path: 'unknown'
get :browse, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: 'unknown' }
expect(response).to be_not_found
end
......@@ -113,7 +113,7 @@ describe Projects::ArtifactsController do
context 'when the file exists' do
it 'renders the file view' do
get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt'
get :file, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt' }
expect(response).to have_gitlab_http_status(302)
end
......@@ -121,7 +121,7 @@ describe Projects::ArtifactsController do
context 'when the file does not exist' do
it 'responds Not Found' do
get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'unknown'
get :file, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: 'unknown' }
expect(response).to be_not_found
end
......@@ -131,7 +131,7 @@ describe Projects::ArtifactsController do
context 'when the file is served through Rails' do
context 'when the file exists' do
it 'renders the file view' do
get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt'
get :file, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: 'ci_artifacts.txt' }
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('projects/artifacts/file')
......@@ -140,7 +140,7 @@ describe Projects::ArtifactsController do
context 'when the file does not exist' do
it 'responds Not Found' do
get :file, namespace_id: project.namespace, project_id: project, job_id: job, path: 'unknown'
get :file, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: 'unknown' }
expect(response).to be_not_found
end
......@@ -159,7 +159,7 @@ describe Projects::ArtifactsController do
end
it 'does not redirect the request' do
get :file, namespace_id: private_project.namespace, project_id: private_project, job_id: job, path: 'ci_artifacts.txt'
get :file, params: { namespace_id: private_project.namespace, project_id: private_project, job_id: job, path: 'ci_artifacts.txt' }
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('projects/artifacts/file')
......@@ -168,7 +168,7 @@ describe Projects::ArtifactsController do
end
describe 'GET raw' do
subject { get(:raw, namespace_id: project.namespace, project_id: project, job_id: job, path: path) }
subject { get(:raw, params: { namespace_id: project.namespace, project_id: project, job_id: job, path: path }) }
context 'when the file exists' do
let(:path) { 'ci_artifacts.txt' }
......@@ -239,7 +239,7 @@ describe Projects::ArtifactsController do
context 'has no such ref' do
before do
get :latest_succeeded, params_from_ref('TAIL', job.name)
get :latest_succeeded, params: params_from_ref('TAIL', job.name)
end
it_behaves_like 'not found'
......@@ -247,7 +247,7 @@ describe Projects::ArtifactsController do
context 'has no such job' do
before do
get :latest_succeeded, params_from_ref(pipeline.ref, 'NOBUILD')
get :latest_succeeded, params: params_from_ref(pipeline.ref, 'NOBUILD')
end
it_behaves_like 'not found'
......@@ -255,7 +255,7 @@ describe Projects::ArtifactsController do
context 'has no path' do
before do
get :latest_succeeded, params_from_ref(pipeline.sha, job.name, '')
get :latest_succeeded, params: params_from_ref(pipeline.sha, job.name, '')
end
it_behaves_like 'not found'
......@@ -276,7 +276,7 @@ describe Projects::ArtifactsController do
pipeline.update(ref: 'master',
sha: project.commit('master').sha)
get :latest_succeeded, params_from_ref('master')
get :latest_succeeded, params: params_from_ref('master')
end
it_behaves_like 'redirect to the job'
......@@ -287,7 +287,7 @@ describe Projects::ArtifactsController do
pipeline.update(ref: 'improve/awesome',
sha: project.commit('improve/awesome').sha)
get :latest_succeeded, params_from_ref('improve/awesome')
get :latest_succeeded, params: params_from_ref('improve/awesome')
end
it_behaves_like 'redirect to the job'
......@@ -298,7 +298,7 @@ describe Projects::ArtifactsController do
pipeline.update(ref: 'improve/awesome',
sha: project.commit('improve/awesome').sha)
get :latest_succeeded, params_from_ref('improve/awesome', job.name, 'file/README.md')
get :latest_succeeded, params: params_from_ref('improve/awesome', job.name, 'file/README.md')
end
it 'redirects' do
......
......@@ -8,7 +8,7 @@ describe Projects::AvatarsController do
end
describe 'GET #show' do
subject { get :show, namespace_id: project.namespace, project_id: project }
subject { get :show, params: { namespace_id: project.namespace, project_id: project } }
context 'when repository has no avatar' do
it 'shows 404' do
......@@ -71,7 +71,7 @@ describe Projects::AvatarsController do
describe 'DELETE #destroy' do
it 'removes avatar from DB by calling destroy' do
delete :destroy, namespace_id: project.namespace.id, project_id: project.id
delete :destroy, params: { namespace_id: project.namespace.id, project_id: project.id }
expect(project.avatar.present?).to be_falsey
expect(project).to be_valid
......
......@@ -23,6 +23,6 @@ describe Projects::BadgesController do
end
def get_badge(badge)
get badge, namespace_id: project.namespace.to_param, project_id: project, ref: pipeline.ref, format: :svg
get badge, params: { namespace_id: project.namespace.to_param, project_id: project, ref: pipeline.ref }, format: :svg
end
end
......@@ -16,9 +16,11 @@ describe Projects::BlameController do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id)
id: id
})
end
context "valid file" do
......
......@@ -11,9 +11,11 @@ describe Projects::BlobController do
context 'with file path' do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id)
id: id
})
end
context "valid branch, valid file" do
......@@ -48,9 +50,11 @@ describe Projects::BlobController do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id,
id: id
},
format: :json)
end
......@@ -66,11 +70,13 @@ describe Projects::BlobController do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id,
format: :json,
viewer: 'none')
viewer: 'none'
},
format: :json)
end
it do
......@@ -84,9 +90,11 @@ describe Projects::BlobController do
context 'with tree path' do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id)
id: id
})
controller.instance_variable_set(:@blob, nil)
end
......@@ -109,7 +117,7 @@ describe Projects::BlobController do
params = { namespace_id: project.namespace,
project_id: project,
id: 'master/CHANGELOG' }
get :diff, params.merge(opts)
get :diff, params: params.merge(opts)
end
before do
......@@ -200,7 +208,7 @@ describe Projects::BlobController do
context 'anonymous' do
before do
get :edit, default_params
get :edit, params: default_params
end
it 'redirects to sign in and returns' do
......@@ -213,7 +221,7 @@ describe Projects::BlobController do
before do
sign_in(guest)
get :edit, default_params
get :edit, params: default_params
end
it 'redirects to blob show' do
......@@ -227,7 +235,7 @@ describe Projects::BlobController do
before do
project.add_developer(developer)
sign_in(developer)
get :edit, default_params
get :edit, params: default_params
end
it 'redirects to blob show' do
......@@ -241,7 +249,7 @@ describe Projects::BlobController do
before do
project.add_maintainer(maintainer)
sign_in(maintainer)
get :edit, default_params
get :edit, params: default_params
end
it 'redirects to blob show' do
......@@ -274,7 +282,7 @@ describe Projects::BlobController do
end
it 'redirects to blob' do
put :update, default_params
put :update, params: default_params
expect(response).to redirect_to(blob_after_edit_path)
end
......@@ -284,7 +292,7 @@ describe Projects::BlobController do
let(:mr_params) { default_params.merge(from_merge_request_iid: merge_request.iid) }
it 'redirects to MR diff' do
put :update, mr_params
put :update, params: mr_params
after_edit_path = diffs_project_merge_request_path(project, merge_request)
file_anchor = "##{Digest::SHA1.hexdigest('CHANGELOG')}"
......@@ -298,7 +306,7 @@ describe Projects::BlobController do
end
it "it redirect to blob" do
put :update, mr_params
put :update, params: mr_params
expect(response).to redirect_to(blob_after_edit_path)
end
......@@ -320,7 +328,7 @@ describe Projects::BlobController do
end
it 'redirects to blob' do
put :update, default_params
put :update, params: default_params
expect(response).to redirect_to(project_blob_path(forked_project, 'master/CHANGELOG'))
end
......@@ -331,7 +339,7 @@ describe Projects::BlobController do
default_params[:branch_name] = "fork-test-1"
default_params[:create_merge_request] = 1
put :update, default_params
put :update, params: default_params
expect(response).to redirect_to(
project_new_merge_request_path(
......@@ -374,7 +382,7 @@ describe Projects::BlobController do
let(:after_delete_path) { project_tree_path(project, 'master/files') }
it 'redirects to the sub directory' do
delete :destroy, default_params
delete :destroy, params: default_params
expect(response).to redirect_to(after_delete_path)
end
......@@ -393,7 +401,7 @@ describe Projects::BlobController do
end
it 'redirects to the project root' do
delete :destroy, default_params
delete :destroy, params: default_params
expect(response).to redirect_to(project_root_path)
end
......@@ -413,7 +421,7 @@ describe Projects::BlobController do
let(:after_delete_path) { project_tree_path(project, 'binary-encoding') }
it 'redirects to the project root of the branch' do
delete :destroy, default_params
delete :destroy, params: default_params
expect(response).to redirect_to(after_delete_path)
end
......
......@@ -121,8 +121,10 @@ describe Projects::BoardsController do
end
def list_boards(format: :html)
get :index, namespace_id: project.namespace,
project_id: project,
get :index, params: {
namespace_id: project.namespace,
project_id: project
},
format: format
end
end
......@@ -207,9 +209,11 @@ describe Projects::BoardsController do
end
def read_board(board:, format: :html)
get :show, namespace_id: project.namespace,
get :show, params: {
namespace_id: project.namespace,
project_id: project,
id: board.to_param,
id: board.to_param
},
format: format
end
end
......
......@@ -22,10 +22,12 @@ describe Projects::BranchesController do
sign_in(user)
post :create,
params: {
namespace_id: project.namespace,
project_id: project,
branch_name: branch,
ref: ref
}
end
context "valid branch name, valid source" do
......@@ -76,10 +78,12 @@ describe Projects::BranchesController do
it 'redirects' do
post :create,
params: {
namespace_id: project.namespace,
project_id: project,
branch_name: branch,
issue_iid: issue.iid
}
expect(subject)
.to redirect_to("/#{project.full_path}/tree/1-feature-branch")
......@@ -89,10 +93,12 @@ describe Projects::BranchesController do
expect(SystemNoteService).to receive(:new_issue_branch).with(issue, project, user, "1-feature-branch")
post :create,
params: {
namespace_id: project.namespace,
project_id: project,
branch_name: branch,
issue_iid: issue.iid
}
end
context 'repository-less project' do
......@@ -105,10 +111,12 @@ describe Projects::BranchesController do
expect(SystemNoteService).to receive(:new_issue_branch).and_return(true)
post :create,
params: {
namespace_id: project.namespace.to_param,
project_id: project.to_param,
branch_name: branch,
issue_iid: issue.iid
}
expect(response).to redirect_to project_tree_path(project, branch)
end
......@@ -121,10 +129,12 @@ describe Projects::BranchesController do
expect(SystemNoteService).to receive(:new_issue_branch).and_return(true)
post :create,
params: {
namespace_id: project.namespace.to_param,
project_id: project.to_param,
branch_name: branch,
issue_iid: issue.iid
}
expect(response.location).to include(project_new_blob_path(project, branch))
expect(response).to have_gitlab_http_status(302)
......@@ -156,10 +166,12 @@ describe Projects::BranchesController do
expect(SystemNoteService).to receive(:new_issue_branch).and_return(true)
post :create,
params: {
namespace_id: project.namespace.to_param,
project_id: project.to_param,
branch_name: branch,
issue_iid: issue.iid
}
expect(response.location).to include(project_new_blob_path(project, branch))
expect(response).to have_gitlab_http_status(302)
......@@ -173,10 +185,12 @@ describe Projects::BranchesController do
expect(SystemNoteService).not_to receive(:new_issue_branch)
post :create,
params: {
namespace_id: project.namespace,
project_id: project,
branch_name: branch,
issue_iid: issue.iid
}
end
end
......@@ -191,10 +205,12 @@ describe Projects::BranchesController do
expect(SystemNoteService).not_to receive(:new_issue_branch)
post :create,
params: {
namespace_id: project.namespace,
project_id: project,
branch_name: branch,
issue_iid: issue.iid
}
end
end
end
......@@ -228,11 +244,14 @@ describe Projects::BranchesController do
end
def create_branch(name:, ref:)
post :create, namespace_id: project.namespace.to_param,
post :create,
format: :json,
params: {
namespace_id: project.namespace.to_param,
project_id: project.to_param,
branch_name: name,
ref: ref,
format: :json
ref: ref
}
end
end
......@@ -246,9 +265,11 @@ describe Projects::BranchesController do
it 'returns 303' do
post :destroy,
format: :html,
params: {
id: 'foo/bar/baz',
namespace_id: project.namespace,
project_id: project
}
expect(response).to have_gitlab_http_status(303)
end
......@@ -262,9 +283,11 @@ describe Projects::BranchesController do
post :destroy,
format: format,
params: {
id: branch,
namespace_id: project.namespace,
project_id: project
}
end
context 'as JS' do
......@@ -359,8 +382,10 @@ describe Projects::BranchesController do
describe "DELETE destroy_all_merged" do
def destroy_all_merged
delete :destroy_all_merged,
params: {
namespace_id: project.namespace,
project_id: project
}
end
context 'when user is allowed to push' do
......@@ -404,10 +429,12 @@ describe Projects::BranchesController do
context 'when rendering a JSON format' do
it 'filters branches by name' do
get :index,
format: :json,
params: {
namespace_id: project.namespace,
project_id: project,
format: :json,
search: 'master'
}
parsed_response = JSON.parse(response.body)
......@@ -423,10 +450,12 @@ describe Projects::BranchesController do
context 'when cache is enabled yet cold', :request_store do
it 'return with a status 200' do
get :index,
format: :html,
params: {
namespace_id: project.namespace,
project_id: project,
state: 'all',
format: :html
state: 'all'
}
expect(response).to have_gitlab_http_status(200)
end
......@@ -439,10 +468,12 @@ describe Projects::BranchesController do
it 'return with a status 200' do
get :index,
format: :html,
params: {
namespace_id: project.namespace,
project_id: project,
state: 'all',
format: :html
state: 'all'
}
expect(response).to have_gitlab_http_status(200)
end
......@@ -451,30 +482,36 @@ describe Projects::BranchesController do
context 'when deprecated sort/search/page parameters are specified' do
it 'returns with a status 301 when sort specified' do
get :index,
format: :html,
params: {
namespace_id: project.namespace,
project_id: project,
sort: 'updated_asc',
format: :html
sort: 'updated_asc'
}
expect(response).to redirect_to project_branches_filtered_path(project, state: 'all')
end
it 'returns with a status 301 when search specified' do
get :index,
format: :html,
params: {
namespace_id: project.namespace,
project_id: project,
search: 'feature',
format: :html
search: 'feature'
}
expect(response).to redirect_to project_branches_filtered_path(project, state: 'all')
end
it 'returns with a status 301 when page specified' do
get :index,
format: :html,
params: {
namespace_id: project.namespace,
project_id: project,
page: 2,
format: :html
page: 2
}
expect(response).to redirect_to project_branches_filtered_path(project, state: 'all')
end
......
......@@ -13,7 +13,7 @@ describe Projects::Ci::LintsController do
before do
project.add_developer(user)
get :show, namespace_id: project.namespace, project_id: project
get :show, params: { namespace_id: project.namespace, project_id: project }
end
it 'should be success' do
......@@ -33,7 +33,7 @@ describe Projects::Ci::LintsController do
before do
project.add_guest(user)
get :show, namespace_id: project.namespace, project_id: project
get :show, params: { namespace_id: project.namespace, project_id: project }
end
it 'should respond with 404' do
......@@ -72,7 +72,7 @@ describe Projects::Ci::LintsController do
WebMock.stub_request(:get, remote_file_path).to_return(body: remote_file_content)
project.add_developer(user)
post :create, namespace_id: project.namespace, project_id: project, content: content
post :create, params: { namespace_id: project.namespace, project_id: project, content: content }
end
it 'should be success' do
......@@ -100,7 +100,7 @@ describe Projects::Ci::LintsController do
before do
project.add_developer(user)
post :create, namespace_id: project.namespace, project_id: project, content: content
post :create, params: { namespace_id: project.namespace, project_id: project, content: content }
end
it 'should assign errors' do
......@@ -112,7 +112,7 @@ describe Projects::Ci::LintsController do
before do
project.add_guest(user)
post :create, namespace_id: project.namespace, project_id: project, content: content
post :create, params: { namespace_id: project.namespace, project_id: project, content: content }
end
it 'should respond with 404' do
......
......@@ -81,7 +81,7 @@ describe Projects::Clusters::ApplicationsController do
end
def go
post :create, params.merge(namespace_id: project.namespace, project_id: project)
post :create, params: params.merge(namespace_id: project.namespace, project_id: project)
end
end
end
......@@ -18,7 +18,7 @@ describe Projects::ClustersController do
describe 'GET index' do
def go(params = {})
get :index, params.reverse_merge(namespace_id: project.namespace.to_param, project_id: project)
get :index, params: params.reverse_merge(namespace_id: project.namespace.to_param, project_id: project)
end
describe 'functionality' do
......@@ -80,7 +80,7 @@ describe Projects::ClustersController do
describe 'GET new' do
def go
get :new, namespace_id: project.namespace, project_id: project
get :new, params: { namespace_id: project.namespace, project_id: project }
end
describe 'functionality for new cluster' do
......@@ -174,7 +174,7 @@ describe Projects::ClustersController do
end
def go
post :create_gcp, params.merge(namespace_id: project.namespace, project_id: project)
post :create_gcp, params: params.merge(namespace_id: project.namespace, project_id: project)
end
describe 'functionality' do
......@@ -261,7 +261,7 @@ describe Projects::ClustersController do
end
def go
post :create_user, params.merge(namespace_id: project.namespace, project_id: project)
post :create_user, params: params.merge(namespace_id: project.namespace, project_id: project)
end
describe 'functionality' do
......@@ -331,9 +331,11 @@ describe Projects::ClustersController do
def go
get :cluster_status,
params: {
namespace_id: project.namespace.to_param,
project_id: project.to_param,
id: cluster,
id: cluster
},
format: :json
end
......@@ -369,9 +371,11 @@ describe Projects::ClustersController do
def go
get :show,
params: {
namespace_id: project.namespace,
project_id: project,
id: cluster
}
end
describe 'functionality' do
......@@ -397,7 +401,7 @@ describe Projects::ClustersController do
describe 'PUT update' do
def go(format: :html)
put :update, params.merge(namespace_id: project.namespace.to_param,
put :update, params: params.merge(namespace_id: project.namespace.to_param,
project_id: project.to_param,
id: cluster,
format: format
......@@ -500,9 +504,11 @@ describe Projects::ClustersController do
def go
delete :destroy,
params: {
namespace_id: project.namespace,
project_id: project,
id: cluster
}
end
describe 'functionality' do
......
......@@ -21,7 +21,7 @@ describe Projects::CommitController do
project_id: project
}
get :show, params.merge(extra_params)
get :show, params: params.merge(extra_params)
end
context 'with valid id' do
......@@ -102,9 +102,11 @@ describe Projects::CommitController do
it 'renders it' do
get(:show,
params: {
namespace_id: fork_project.namespace,
project_id: fork_project,
id: commit.id)
id: commit.id
})
expect(response).to be_success
end
......@@ -132,9 +134,11 @@ describe Projects::CommitController do
commit = project.commit('5937ac0a7beb003549fc5fd26fc247adbce4a52e')
get(:branches,
params: {
namespace_id: project.namespace,
project_id: project,
id: commit.id)
id: commit.id
})
expect(assigns(:branches)).to include('master', 'feature_conflict')
expect(assigns(:branches_limit_exceeded)).to be_falsey
......@@ -148,9 +152,11 @@ describe Projects::CommitController do
allow_any_instance_of(Repository).to receive(:tag_count).and_return(1001)
get(:branches,
params: {
namespace_id: project.namespace,
project_id: project,
id: commit.id)
id: commit.id
})
expect(assigns(:branches)).to eq([])
expect(assigns(:branches_limit_exceeded)).to be_truthy
......@@ -163,9 +169,11 @@ describe Projects::CommitController do
context 'when target branch is not provided' do
it 'renders the 404 page' do
post(:revert,
params: {
namespace_id: project.namespace,
project_id: project,
id: commit.id)
id: commit.id
})
expect(response).not_to be_success
expect(response).to have_gitlab_http_status(404)
......@@ -175,10 +183,12 @@ describe Projects::CommitController do
context 'when the revert was successful' do
it 'redirects to the commits page' do
post(:revert,
params: {
namespace_id: project.namespace,
project_id: project,
start_branch: 'master',
id: commit.id)
id: commit.id
})
expect(response).to redirect_to project_commits_path(project, 'master')
expect(flash[:notice]).to eq('The commit has been successfully reverted.')
......@@ -188,19 +198,23 @@ describe Projects::CommitController do
context 'when the revert failed' do
before do
post(:revert,
params: {
namespace_id: project.namespace,
project_id: project,
start_branch: 'master',
id: commit.id)
id: commit.id
})
end
it 'redirects to the commit page' do
# Reverting a commit that has been already reverted.
post(:revert,
params: {
namespace_id: project.namespace,
project_id: project,
start_branch: 'master',
id: commit.id)
id: commit.id
})
expect(response).to redirect_to project_commit_path(project, commit.id)
expect(flash[:alert]).to match('Sorry, we cannot revert this commit automatically.')
......@@ -212,9 +226,11 @@ describe Projects::CommitController do
context 'when target branch is not provided' do
it 'renders the 404 page' do
post(:cherry_pick,
params: {
namespace_id: project.namespace,
project_id: project,
id: master_pickable_commit.id)
id: master_pickable_commit.id
})
expect(response).not_to be_success
expect(response).to have_gitlab_http_status(404)
......@@ -224,10 +240,12 @@ describe Projects::CommitController do
context 'when the cherry-pick was successful' do
it 'redirects to the commits page' do
post(:cherry_pick,
params: {
namespace_id: project.namespace,
project_id: project,
start_branch: 'master',
id: master_pickable_commit.id)
id: master_pickable_commit.id
})
expect(response).to redirect_to project_commits_path(project, 'master')
expect(flash[:notice]).to eq('The commit has been successfully cherry-picked into master.')
......@@ -237,19 +255,23 @@ describe Projects::CommitController do
context 'when the cherry_pick failed' do
before do
post(:cherry_pick,
params: {
namespace_id: project.namespace,
project_id: project,
start_branch: 'master',
id: master_pickable_commit.id)
id: master_pickable_commit.id
})
end
it 'redirects to the commit page' do
# Cherry-picking a commit that has been already cherry-picked.
post(:cherry_pick,
params: {
namespace_id: project.namespace,
project_id: project,
start_branch: 'master',
id: master_pickable_commit.id)
id: master_pickable_commit.id
})
expect(response).to redirect_to project_commit_path(project, master_pickable_commit.id)
expect(flash[:alert]).to match('Sorry, we cannot cherry-pick this commit automatically.')
......@@ -264,7 +286,7 @@ describe Projects::CommitController do
project_id: project
}
get :diff_for_path, params.merge(extra_params)
get :diff_for_path, params: params.merge(extra_params)
end
let(:existing_path) { '.gitmodules' }
......@@ -332,7 +354,7 @@ describe Projects::CommitController do
project_id: project
}
get :pipelines, params.merge(extra_params)
get :pipelines, params: params.merge(extra_params)
end
context 'when the commit exists' do
......
......@@ -17,8 +17,10 @@ describe Projects::CommitsController do
context "no ref is provided" do
it 'should redirect to the default branch of the project' do
get(:commits_root,
params: {
namespace_id: project.namespace,
project_id: project)
project_id: project
})
expect(response).to redirect_to project_commits_path(project)
end
......@@ -31,9 +33,11 @@ describe Projects::CommitsController do
context 'with file path' do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id)
id: id
})
end
context "valid branch, valid file" do
......@@ -65,9 +69,11 @@ describe Projects::CommitsController do
context "when the ref does not exist with the suffix" do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: "master.atom")
id: "master.atom"
})
end
it "renders as atom" do
......@@ -88,9 +94,11 @@ describe Projects::CommitsController do
allow_any_instance_of(Repository).to receive(:commit).with('master.atom').and_return(commit)
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: "master.atom")
id: "master.atom"
})
end
it "renders as HTML" do
......@@ -106,9 +114,11 @@ describe Projects::CommitsController do
before do
get(:signatures,
params: {
namespace_id: project.namespace,
project_id: project,
id: id,
id: id
},
format: :json)
end
......
......@@ -13,7 +13,7 @@ describe Projects::CompareController do
render_views
before do
get :index, namespace_id: project.namespace, project_id: project
get :index, params: { namespace_id: project.namespace, project_id: project }
end
it 'returns successfully' do
......@@ -24,7 +24,7 @@ describe Projects::CompareController do
describe 'GET show' do
render_views
subject(:show_request) { get :show, request_params }
subject(:show_request) { get :show, params: request_params }
let(:request_params) do
{
......@@ -130,7 +130,7 @@ describe Projects::CompareController do
project_id: project
}
get :diff_for_path, params.merge(extra_params)
get :diff_for_path, params: params.merge(extra_params)
end
let(:existing_path) { 'files/ruby/feature.rb' }
......@@ -201,7 +201,7 @@ describe Projects::CompareController do
end
describe 'POST create' do
subject(:create_request) { post :create, request_params }
subject(:create_request) { post :create, params: request_params }
let(:request_params) do
{
......@@ -260,7 +260,7 @@ describe Projects::CompareController do
end
describe 'GET signatures' do
subject(:signatures_request) { get :signatures, request_params }
subject(:signatures_request) { get :signatures, params: request_params }
let(:request_params) do
{
......
......@@ -13,8 +13,10 @@ describe Projects::CycleAnalyticsController do
context 'with no data' do
it 'is true' do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project)
project_id: project
})
expect(response).to be_success
expect(assigns(:cycle_analytics_no_data)).to eq(true)
......@@ -32,8 +34,10 @@ describe Projects::CycleAnalyticsController do
it 'is false' do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project)
project_id: project
})
expect(response).to be_success
expect(assigns(:cycle_analytics_no_data)).to eq(false)
......
......@@ -17,7 +17,7 @@ describe Projects::DeployKeysController do
context 'when html requested' do
it 'redirects to blob' do
get :index, params
get :index, params: params
expect(response).to redirect_to(project_settings_repository_path(project, anchor: 'js-deploy-keys-settings'))
end
......@@ -48,7 +48,7 @@ describe Projects::DeployKeysController do
end
it 'returns json in a correct format' do
get :index, params.merge(format: :json)
get :index, params: params.merge(format: :json)
json = JSON.parse(response.body)
......@@ -74,7 +74,7 @@ describe Projects::DeployKeysController do
it 'redirects to login' do
expect do
put :enable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :enable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
end.not_to change { DeployKeysProject.count }
expect(response).to have_http_status(302)
......@@ -89,7 +89,7 @@ describe Projects::DeployKeysController do
it 'returns 404' do
expect do
put :enable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :enable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
end.not_to change { DeployKeysProject.count }
expect(response).to have_http_status(404)
......@@ -103,7 +103,7 @@ describe Projects::DeployKeysController do
it 'returns 302' do
expect do
put :enable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :enable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
end.to change { DeployKeysProject.count }.by(1)
expect(DeployKeysProject.where(project_id: project.id, deploy_key_id: deploy_key.id).count).to eq(1)
......@@ -112,7 +112,7 @@ describe Projects::DeployKeysController do
end
it 'returns 404' do
put :enable, id: 0, namespace_id: project.namespace, project_id: project
put :enable, params: { id: 0, namespace_id: project.namespace, project_id: project }
expect(response).to have_http_status(404)
end
......@@ -125,7 +125,7 @@ describe Projects::DeployKeysController do
it 'returns 302' do
expect do
put :enable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :enable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
end.to change { DeployKeysProject.count }.by(1)
expect(DeployKeysProject.where(project_id: project.id, deploy_key_id: deploy_key.id).count).to eq(1)
......@@ -145,7 +145,7 @@ describe Projects::DeployKeysController do
end
it 'redirects to login' do
put :disable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :disable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
expect(response).to have_http_status(302)
expect(response).to redirect_to(new_user_session_path)
......@@ -159,7 +159,7 @@ describe Projects::DeployKeysController do
end
it 'returns 404' do
put :disable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :disable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
expect(response).to have_http_status(404)
expect(DeployKey.find(deploy_key.id)).to eq(deploy_key)
......@@ -168,7 +168,7 @@ describe Projects::DeployKeysController do
context 'with user with permission' do
it 'returns 302' do
put :disable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :disable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
expect(response).to have_http_status(302)
expect(response).to redirect_to(namespace_project_settings_repository_path(anchor: 'js-deploy-keys-settings'))
......@@ -177,7 +177,7 @@ describe Projects::DeployKeysController do
end
it 'returns 404' do
put :disable, id: 0, namespace_id: project.namespace, project_id: project
put :disable, params: { id: 0, namespace_id: project.namespace, project_id: project }
expect(response).to have_http_status(404)
end
......@@ -190,7 +190,7 @@ describe Projects::DeployKeysController do
it 'returns 302' do
expect do
put :disable, id: deploy_key.id, namespace_id: project.namespace, project_id: project
put :disable, params: { id: deploy_key.id, namespace_id: project.namespace, project_id: project }
end.to change { DeployKey.count }.by(-1)
expect(response).to have_http_status(302)
......
......@@ -19,7 +19,7 @@ describe Projects::DeploymentsController do
create(:deployment, :success, environment: environment, created_at: 7.hours.ago)
create(:deployment, :success, environment: environment)
get :index, deployment_params(after: 8.hours.ago)
get :index, params: deployment_params(after: 8.hours.ago)
expect(response).to be_ok
......@@ -29,7 +29,7 @@ describe Projects::DeploymentsController do
it 'returns a list with deployments information' do
create(:deployment, :success, environment: environment)
get :index, deployment_params
get :index, params: deployment_params
expect(response).to be_ok
expect(response).to match_response_schema('deployments')
......@@ -49,7 +49,7 @@ describe Projects::DeploymentsController do
end
it 'responds with not found' do
get :metrics, deployment_params(id: deployment.id)
get :metrics, params: deployment_params(id: deployment.id)
expect(response).to be_not_found
end
......@@ -66,7 +66,7 @@ describe Projects::DeploymentsController do
end
it 'returns a empty response 204 resposne' do
get :metrics, deployment_params(id: deployment.id)
get :metrics, params: deployment_params(id: deployment.id)
expect(response).to have_gitlab_http_status(204)
expect(response.body).to eq('')
end
......@@ -86,7 +86,7 @@ describe Projects::DeploymentsController do
end
it 'returns a metrics JSON document' do
get :metrics, deployment_params(id: deployment.id)
get :metrics, params: deployment_params(id: deployment.id)
expect(response).to be_ok
expect(json_response['success']).to be(true)
......@@ -101,7 +101,7 @@ describe Projects::DeploymentsController do
end
it 'responds with not found' do
get :metrics, deployment_params(id: deployment.id)
get :metrics, params: deployment_params(id: deployment.id)
expect(response).to be_not_found
end
......@@ -122,7 +122,7 @@ describe Projects::DeploymentsController do
end
it 'responds with not found' do
get :metrics, deployment_params(id: deployment.id)
get :metrics, params: deployment_params(id: deployment.id)
expect(response).to be_not_found
end
......@@ -141,7 +141,7 @@ describe Projects::DeploymentsController do
end
it 'returns a empty response 204 response' do
get :additional_metrics, deployment_params(id: deployment.id, format: :json)
get :additional_metrics, params: deployment_params(id: deployment.id, format: :json)
expect(response).to have_gitlab_http_status(204)
expect(response.body).to eq('')
end
......@@ -161,7 +161,7 @@ describe Projects::DeploymentsController do
end
it 'returns a metrics JSON document' do
get :additional_metrics, deployment_params(id: deployment.id, format: :json)
get :additional_metrics, params: deployment_params(id: deployment.id, format: :json)
expect(response).to be_ok
expect(json_response['success']).to be(true)
......
......@@ -23,7 +23,7 @@ describe Projects::DiscussionsController do
context 'when user is not authorized to read the MR' do
it 'returns 404' do
get :show, request_params, format: :json
get :show, params: request_params, session: { format: :json }
expect(response).to have_gitlab_http_status(404)
end
......@@ -35,7 +35,7 @@ describe Projects::DiscussionsController do
end
it 'returns status 200' do
get :show, request_params, format: :json
get :show, params: request_params, session: { format: :json }
expect(response).to have_gitlab_http_status(200)
end
......@@ -43,7 +43,7 @@ describe Projects::DiscussionsController do
it 'returns status 404 if MR does not exists' do
merge_request.destroy!
get :show, request_params, format: :json
get :show, params: request_params, session: { format: :json }
expect(response).to have_gitlab_http_status(404)
end
......@@ -56,7 +56,7 @@ describe Projects::DiscussionsController do
end
it 'returns status 200' do
get :show, request_params, format: :json
get :show, params: request_params, session: { format: :json }
expect(response).to have_gitlab_http_status(200)
end
......@@ -70,7 +70,7 @@ describe Projects::DiscussionsController do
context "when the user is not authorized to resolve the discussion" do
it "returns status 404" do
post :resolve, request_params
post :resolve, params: request_params
expect(response).to have_gitlab_http_status(404)
end
......@@ -87,7 +87,7 @@ describe Projects::DiscussionsController do
end
it "returns status 404" do
post :resolve, request_params
post :resolve, params: request_params
expect(response).to have_gitlab_http_status(404)
end
......@@ -95,7 +95,7 @@ describe Projects::DiscussionsController do
context "when the discussion is resolvable" do
it "resolves the discussion" do
post :resolve, request_params
post :resolve, params: request_params
expect(note.reload.discussion.resolved?).to be true
expect(note.reload.discussion.resolved_by).to eq(user)
......@@ -104,17 +104,17 @@ describe Projects::DiscussionsController do
it "sends notifications if all discussions are resolved" do
expect_any_instance_of(MergeRequests::ResolvedDiscussionNotificationService).to receive(:execute).with(merge_request)
post :resolve, request_params
post :resolve, params: request_params
end
it "returns the name of the resolving user" do
post :resolve, request_params
post :resolve, params: request_params
expect(JSON.parse(response.body)['resolved_by']['name']).to eq(user.name)
end
it "returns status 200" do
post :resolve, request_params
post :resolve, params: request_params
expect(response).to have_gitlab_http_status(200)
end
......@@ -123,7 +123,7 @@ describe Projects::DiscussionsController do
expect_any_instance_of(DiscussionSerializer).to receive(:represent)
.with(instance_of(Discussion), { context: instance_of(described_class), render_truncated_diff_lines: true })
post :resolve, request_params
post :resolve, params: request_params
end
context 'diff discussion' do
......@@ -131,7 +131,7 @@ describe Projects::DiscussionsController do
let(:discussion) { note.discussion }
it "returns truncated diff lines" do
post :resolve, request_params
post :resolve, params: request_params
expect(JSON.parse(response.body)['truncated_diff_lines']).to be_present
end
......@@ -149,7 +149,7 @@ describe Projects::DiscussionsController do
context "when the user is not authorized to resolve the discussion" do
it "returns status 404" do
delete :unresolve, request_params
delete :unresolve, params: request_params
expect(response).to have_gitlab_http_status(404)
end
......@@ -166,7 +166,7 @@ describe Projects::DiscussionsController do
end
it "returns status 404" do
delete :unresolve, request_params
delete :unresolve, params: request_params
expect(response).to have_gitlab_http_status(404)
end
......@@ -174,13 +174,13 @@ describe Projects::DiscussionsController do
context "when the discussion is resolvable" do
it "unresolves the discussion" do
delete :unresolve, request_params
delete :unresolve, params: request_params
expect(note.reload.discussion.resolved?).to be false
end
it "returns status 200" do
delete :unresolve, request_params
delete :unresolve, params: request_params
expect(response).to have_gitlab_http_status(200)
end
......@@ -194,7 +194,7 @@ describe Projects::DiscussionsController do
expect_any_instance_of(DiscussionSerializer).to receive(:represent)
.with(instance_of(Discussion), { context: instance_of(described_class), render_truncated_diff_lines: true })
delete :unresolve, request_params
delete :unresolve, params: request_params
end
end
end
......
......@@ -17,7 +17,7 @@ describe Projects::EnvironmentsController do
describe 'GET index' do
context 'when a request for the HTML is made' do
it 'responds with status code 200' do
get :index, environment_params
get :index, params: environment_params
expect(response).to have_gitlab_http_status(:ok)
end
......@@ -26,7 +26,7 @@ describe Projects::EnvironmentsController do
expect_any_instance_of(Gitlab::EtagCaching::Store)
.to receive(:touch).with(project_environments_path(project, format: :json))
get :index, environment_params
get :index, params: environment_params
end
end
......@@ -49,7 +49,7 @@ describe Projects::EnvironmentsController do
context 'when requesting available environments scope' do
before do
get :index, environment_params(format: :json, scope: :available)
get :index, params: environment_params(format: :json, scope: :available)
end
it 'responds with a payload describing available environments' do
......@@ -73,7 +73,7 @@ describe Projects::EnvironmentsController do
context 'when requesting stopped environments scope' do
before do
get :index, environment_params(format: :json, scope: :stopped)
get :index, params: environment_params(format: :json, scope: :stopped)
end
it 'responds with a payload describing stopped environments' do
......@@ -103,9 +103,11 @@ describe Projects::EnvironmentsController do
context 'when using default format' do
it 'responds with HTML' do
get :folder, namespace_id: project.namespace,
get :folder, params: {
namespace_id: project.namespace,
project_id: project,
id: 'staging-1.0'
}
expect(response).to be_ok
expect(response).to render_template 'folder'
......@@ -114,9 +116,11 @@ describe Projects::EnvironmentsController do
context 'when using JSON format' do
it 'sorts the subfolders lexicographically' do
get :folder, namespace_id: project.namespace,
get :folder, params: {
namespace_id: project.namespace,
project_id: project,
id: 'staging-1.0',
id: 'staging-1.0'
},
format: :json
expect(response).to be_ok
......@@ -132,7 +136,7 @@ describe Projects::EnvironmentsController do
describe 'GET show' do
context 'with valid id' do
it 'responds with a status code 200' do
get :show, environment_params
get :show, params: environment_params
expect(response).to be_ok
end
......@@ -142,7 +146,7 @@ describe Projects::EnvironmentsController do
it 'responds with a status code 404' do
params = environment_params
params[:id] = 12345
get :show, params
get :show, params: params
expect(response).to have_gitlab_http_status(404)
end
......@@ -151,7 +155,7 @@ describe Projects::EnvironmentsController do
describe 'GET edit' do
it 'responds with a status code 200' do
get :edit, environment_params
get :edit, params: environment_params
expect(response).to be_ok
end
......@@ -160,7 +164,7 @@ describe Projects::EnvironmentsController do
describe 'PATCH #update' do
it 'responds with a 302' do
patch_params = environment_params.merge(environment: { external_url: 'https://git.gitlab.com' })
patch :update, patch_params
patch :update, params: patch_params
expect(response).to have_gitlab_http_status(302)
end
......@@ -171,7 +175,7 @@ describe Projects::EnvironmentsController do
it 'returns 404' do
allow_any_instance_of(Environment).to receive(:available?) { false }
patch :stop, environment_params(format: :json)
patch :stop, params: environment_params(format: :json)
expect(response).to have_gitlab_http_status(404)
end
......@@ -184,7 +188,7 @@ describe Projects::EnvironmentsController do
allow_any_instance_of(Environment)
.to receive_messages(available?: true, stop_with_action!: action)
patch :stop, environment_params(format: :json)
patch :stop, params: environment_params(format: :json)
expect(response).to have_gitlab_http_status(200)
expect(json_response).to eq(
......@@ -198,7 +202,7 @@ describe Projects::EnvironmentsController do
allow_any_instance_of(Environment)
.to receive_messages(available?: true, stop_with_action!: nil)
patch :stop, environment_params(format: :json)
patch :stop, params: environment_params(format: :json)
expect(response).to have_gitlab_http_status(200)
expect(json_response).to eq(
......@@ -211,7 +215,7 @@ describe Projects::EnvironmentsController do
describe 'GET #terminal' do
context 'with valid id' do
it 'responds with a status code 200' do
get :terminal, environment_params
get :terminal, params: environment_params
expect(response).to have_gitlab_http_status(200)
end
......@@ -222,13 +226,13 @@ describe Projects::EnvironmentsController do
expect_any_instance_of(defined?(EE) ? EE::Environment : Environment)
.to receive(:terminals)
get :terminal, environment_params
get :terminal, params: environment_params
end
end
context 'with invalid id' do
it 'responds with a status code 404' do
get :terminal, environment_params(id: 666)
get :terminal, params: environment_params(id: 666)
expect(response).to have_gitlab_http_status(404)
end
......@@ -254,7 +258,7 @@ describe Projects::EnvironmentsController do
.with(:fake_terminal)
.and_return(workhorse: :response)
get :terminal_websocket_authorize, environment_params
get :terminal_websocket_authorize, params: environment_params
expect(response).to have_gitlab_http_status(200)
expect(response.headers["Content-Type"]).to eq(Gitlab::Workhorse::INTERNAL_API_CONTENT_TYPE)
......@@ -264,7 +268,7 @@ describe Projects::EnvironmentsController do
context 'and invalid id' do
it 'returns 404' do
get :terminal_websocket_authorize, environment_params(id: 666)
get :terminal_websocket_authorize, params: environment_params(id: 666)
expect(response).to have_gitlab_http_status(404)
end
......@@ -275,7 +279,7 @@ describe Projects::EnvironmentsController do
it 'aborts with an exception' do
allow(Gitlab::Workhorse).to receive(:verify_api_request!).and_raise(JWT::DecodeError)
expect { get :terminal_websocket_authorize, environment_params }.to raise_error(JWT::DecodeError)
expect { get :terminal_websocket_authorize, params: environment_params }.to raise_error(JWT::DecodeError)
# controller tests don't set the response status correctly. It's enough
# to check that the action raised an exception
end
......@@ -288,13 +292,13 @@ describe Projects::EnvironmentsController do
it 'redirects to environment if it exists' do
environment = create(:environment, name: 'production', project: project)
get :metrics_redirect, namespace_id: project.namespace, project_id: project
get :metrics_redirect, params: { namespace_id: project.namespace, project_id: project }
expect(response).to redirect_to(environment_metrics_path(environment))
end
it 'redirects to empty page if no environment exists' do
get :metrics_redirect, namespace_id: project.namespace, project_id: project
get :metrics_redirect, params: { namespace_id: project.namespace, project_id: project }
expect(response).to be_ok
expect(response).to render_template 'empty'
......@@ -312,14 +316,14 @@ describe Projects::EnvironmentsController do
end
it 'returns a metrics page' do
get :metrics, environment_params
get :metrics, params: environment_params
expect(response).to be_ok
end
context 'when requesting metrics as JSON' do
it 'returns a metrics JSON document' do
get :metrics, environment_params(format: :json)
get :metrics, params: environment_params(format: :json)
expect(response).to have_gitlab_http_status(204)
expect(json_response).to eq({})
......@@ -337,7 +341,7 @@ describe Projects::EnvironmentsController do
end
it 'returns a metrics JSON document' do
get :metrics, environment_params(format: :json)
get :metrics, params: environment_params(format: :json)
expect(response).to be_ok
expect(json_response['success']).to be(true)
......@@ -359,7 +363,7 @@ describe Projects::EnvironmentsController do
context 'when requesting metrics as JSON' do
it 'returns a metrics JSON document' do
get :additional_metrics, environment_params(format: :json)
get :additional_metrics, params: environment_params(format: :json)
expect(response).to have_gitlab_http_status(204)
expect(json_response).to eq({})
......@@ -379,7 +383,7 @@ describe Projects::EnvironmentsController do
end
it 'returns a metrics JSON document' do
get :additional_metrics, environment_params(format: :json)
get :additional_metrics, params: environment_params(format: :json)
expect(response).to be_ok
expect(json_response['success']).to be(true)
......
......@@ -17,9 +17,11 @@ describe Projects::FindFileController do
before do
get(:show,
params: {
namespace_id: project.namespace,
project_id: project,
id: id)
id: id
})
end
context "valid branch" do
......@@ -36,9 +38,11 @@ describe Projects::FindFileController do
describe "GET #list" do
def go(format: 'json')
get :list,
params: {
namespace_id: project.namespace,
project_id: project,
id: id,
id: id
},
format: format
end
......
......@@ -13,8 +13,10 @@ describe Projects::ForksController do
describe 'GET index' do
def get_forks
get :index,
params: {
namespace_id: project.namespace,
project_id: project
}
end
context 'when fork is public' do
......@@ -83,8 +85,10 @@ describe Projects::ForksController do
describe 'GET new' do
def get_new
get :new,
params: {
namespace_id: project.namespace,
project_id: project
}
end
context 'when user is signed in' do
......@@ -111,9 +115,11 @@ describe Projects::ForksController do
describe 'POST create' do
def post_create
post :create,
params: {
namespace_id: project.namespace,
project_id: project,
namespace_key: user.namespace.id
}
end
context 'when user is signed in' do
......
......@@ -11,7 +11,7 @@ describe Projects::GraphsController do
describe 'GET languages' do
it "redirects_to action charts" do
get(:commits, namespace_id: project.namespace.path, project_id: project.path, id: 'master')
get(:commits, params: { namespace_id: project.namespace.path, project_id: project.path, id: 'master' })
expect(response).to redirect_to action: :charts
end
......@@ -19,7 +19,7 @@ describe Projects::GraphsController do
describe 'GET commits' do
it "redirects_to action charts" do
get(:commits, namespace_id: project.namespace.path, project_id: project.path, id: 'master')
get(:commits, params: { namespace_id: project.namespace.path, project_id: project.path, id: 'master' })
expect(response).to redirect_to action: :charts
end
......
......@@ -14,10 +14,12 @@ describe Projects::GroupLinksController do
describe '#create' do
shared_context 'link project to group' do
before do
post(:create, namespace_id: project.namespace,
post(:create, params: {
namespace_id: project.namespace,
project_id: project,
link_group_id: group.id,
link_group_access: ProjectGroupLink.default_access)
link_group_access: ProjectGroupLink.default_access
})
end
end
......@@ -65,10 +67,12 @@ describe Projects::GroupLinksController do
context 'when project group id equal link group id' do
before do
post(:create, namespace_id: project.namespace,
post(:create, params: {
namespace_id: project.namespace,
project_id: project,
link_group_id: group2.id,
link_group_access: ProjectGroupLink.default_access)
link_group_access: ProjectGroupLink.default_access
})
end
it 'does not share project with selected group' do
......@@ -84,9 +88,11 @@ describe Projects::GroupLinksController do
context 'when link group id is not present' do
before do
post(:create, namespace_id: project.namespace,
post(:create, params: {
namespace_id: project.namespace,
project_id: project,
link_group_access: ProjectGroupLink.default_access)
link_group_access: ProjectGroupLink.default_access
})
end
it 'redirects to project group links page' do
......
......@@ -11,7 +11,7 @@ describe Projects::HooksController do
describe '#index' do
it 'redirects to settings/integrations page' do
get(:index, namespace_id: project.namespace, project_id: project)
get(:index, params: { namespace_id: project.namespace, project_id: project })
expect(response).to redirect_to(
project_settings_integrations_path(project)
......@@ -38,7 +38,7 @@ describe Projects::HooksController do
wiki_page_events: true
}
post :create, namespace_id: project.namespace, project_id: project, hook: hook_params
post :create, params: { namespace_id: project.namespace, project_id: project, hook: hook_params }
expect(response).to have_http_status(302)
expect(ProjectHook.all.size).to eq(1)
......
......@@ -12,13 +12,13 @@ describe Projects::ImportsController do
describe 'GET #show' do
context 'when repository does not exists' do
it 'renders template' do
get :show, namespace_id: project.namespace.to_param, project_id: project
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(response).to render_template :show
end
it 'sets flash.now if params is present' do
get :show, namespace_id: project.namespace.to_param, project_id: project, continue: { to: '/', notice_now: 'Started' }
get :show, params: { namespace_id: project.namespace.to_param, project_id: project, continue: { to: '/', notice_now: 'Started' } }
expect(flash.now[:notice]).to eq 'Started'
end
......@@ -34,13 +34,13 @@ describe Projects::ImportsController do
end
it 'renders template' do
get :show, namespace_id: project.namespace.to_param, project_id: project
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(response).to render_template :show
end
it 'sets flash.now if params is present' do
get :show, namespace_id: project.namespace.to_param, project_id: project, continue: { to: '/', notice_now: 'In progress' }
get :show, params: { namespace_id: project.namespace.to_param, project_id: project, continue: { to: '/', notice_now: 'In progress' } }
expect(flash.now[:notice]).to eq 'In progress'
end
......@@ -52,7 +52,7 @@ describe Projects::ImportsController do
end
it 'redirects to new_namespace_project_import_path' do
get :show, namespace_id: project.namespace.to_param, project_id: project
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(response).to redirect_to new_project_import_path(project)
end
......@@ -67,7 +67,7 @@ describe Projects::ImportsController do
it 'redirects to namespace_project_path' do
allow_any_instance_of(Project).to receive(:forked?).and_return(true)
get :show, namespace_id: project.namespace.to_param, project_id: project
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(flash[:notice]).to eq 'The project was successfully forked.'
expect(response).to redirect_to project_path(project)
......@@ -76,7 +76,7 @@ describe Projects::ImportsController do
context 'when project is external' do
it 'redirects to namespace_project_path' do
get :show, namespace_id: project.namespace.to_param, project_id: project
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(flash[:notice]).to eq 'The project was successfully imported.'
expect(response).to redirect_to project_path(project)
......@@ -92,7 +92,7 @@ describe Projects::ImportsController do
end
it 'redirects to internal params[:to]' do
get :show, namespace_id: project.namespace.to_param, project_id: project, continue: params
get :show, params: { namespace_id: project.namespace.to_param, project_id: project, continue: params }
expect(flash[:notice]).to eq params[:notice]
expect(response).to redirect_to params[:to]
......@@ -101,7 +101,7 @@ describe Projects::ImportsController do
it 'does not redirect to external params[:to]' do
params[:to] = "//google.com"
get :show, namespace_id: project.namespace.to_param, project_id: project, continue: params
get :show, params: { namespace_id: project.namespace.to_param, project_id: project, continue: params }
expect(response).not_to redirect_to params[:to]
end
end
......@@ -113,7 +113,7 @@ describe Projects::ImportsController do
end
it 'redirects to namespace_project_path' do
get :show, namespace_id: project.namespace.to_param, project_id: project
get :show, params: { namespace_id: project.namespace.to_param, project_id: project }
expect(response).to redirect_to project_path(project)
end
......
......@@ -96,7 +96,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
project_id: project
}
get :index, params.merge(extra_params)
get :index, params: params.merge(extra_params)
end
end
......@@ -461,7 +461,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
project_id: project
}
get :show, params.merge(extra_params)
get :show, params: params.merge(extra_params)
end
end
......@@ -552,9 +552,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def get_trace
get :trace, namespace_id: project.namespace,
get :trace, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id,
id: job.id
},
format: :json
end
end
......@@ -564,9 +566,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
let(:status) { job.detailed_status(double('user')) }
before do
get :status, namespace_id: project.namespace,
get :status, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id,
id: job.id
},
format: :json
end
......@@ -605,9 +609,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def post_retry
post :retry, namespace_id: project.namespace,
post :retry, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id
}
end
end
......@@ -645,9 +651,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def post_play
post :play, namespace_id: project.namespace,
post :play, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id
}
end
end
......@@ -714,7 +722,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def post_cancel(additional_params = {})
post :cancel, { namespace_id: project.namespace,
post :cancel, params: { namespace_id: project.namespace,
project_id: project,
id: job.id }.merge(additional_params)
end
......@@ -754,9 +762,11 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def post_unschedule
post :unschedule, namespace_id: project.namespace,
post :unschedule, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id
}
end
end
......@@ -797,8 +807,10 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def post_cancel_all
post :cancel_all, namespace_id: project.namespace,
post :cancel_all, params: {
namespace_id: project.namespace,
project_id: project
}
end
end
......@@ -860,17 +872,21 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
end
def post_erase
post :erase, namespace_id: project.namespace,
post :erase, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id
}
end
end
describe 'GET raw' do
subject do
post :raw, namespace_id: project.namespace,
post :raw, params: {
namespace_id: project.namespace,
project_id: project,
id: job.id
}
end
context "when job has a trace artifact" do
......@@ -1020,7 +1036,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
project_id: project
}
get :terminal, params.merge(extra_params)
get :terminal, params: params.merge(extra_params)
end
end
......@@ -1074,7 +1090,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
project_id: project
}
get :terminal_websocket_authorize, params.merge(extra_params)
get :terminal_websocket_authorize, params: params.merge(extra_params)
end
end
end
......@@ -17,8 +17,10 @@ describe Projects::MattermostsController do
it 'accepts the request' do
get(:new,
params: {
namespace_id: project.namespace.to_param,
project_id: project)
project_id: project
})
expect(response).to have_gitlab_http_status(200)
end
......@@ -29,9 +31,11 @@ describe Projects::MattermostsController do
subject do
post(:create,
params: {
namespace_id: project.namespace.to_param,
project_id: project,
mattermost: mattermost_params)
mattermost: mattermost_params
})
end
context 'no request can be made to mattermost' do
......
......@@ -21,9 +21,11 @@ describe Projects::MergeRequests::ConflictsController do
.and_raise(Gitlab::Git::Conflict::Parser::UnmergeableFile)
get :show,
params: {
namespace_id: merge_request_with_conflicts.project.namespace.to_param,
project_id: merge_request_with_conflicts.project,
id: merge_request_with_conflicts.iid,
id: merge_request_with_conflicts.iid
},
format: 'json'
end
......@@ -39,9 +41,11 @@ describe Projects::MergeRequests::ConflictsController do
context 'with valid conflicts' do
before do
get :show,
params: {
namespace_id: merge_request_with_conflicts.project.namespace.to_param,
project_id: merge_request_with_conflicts.project,
id: merge_request_with_conflicts.iid,
id: merge_request_with_conflicts.iid
},
format: 'json'
end
......@@ -99,11 +103,13 @@ describe Projects::MergeRequests::ConflictsController do
describe 'GET conflict_for_path' do
def conflict_for_path(path)
get :conflict_for_path,
params: {
namespace_id: merge_request_with_conflicts.project.namespace.to_param,
project_id: merge_request_with_conflicts.project,
id: merge_request_with_conflicts.iid,
old_path: path,
new_path: path,
new_path: path
},
format: 'json'
end
......@@ -160,12 +166,14 @@ describe Projects::MergeRequests::ConflictsController do
def resolve_conflicts(files)
post :resolve_conflicts,
params: {
namespace_id: merge_request_with_conflicts.project.namespace.to_param,
project_id: merge_request_with_conflicts.project,
id: merge_request_with_conflicts.iid,
format: 'json',
files: files,
commit_message: 'Commit message'
},
format: 'json'
end
context 'with valid params' do
......
......@@ -20,7 +20,7 @@ describe Projects::MergeRequests::DiffsController do
format: 'json'
}
get :show, params.merge(extra_params)
get :show, params: params.merge(extra_params)
end
context 'with default params' do
......@@ -89,7 +89,7 @@ describe Projects::MergeRequests::DiffsController do
format: 'json'
}
get :diff_for_path, params.merge(extra_params)
get :diff_for_path, params: params.merge(extra_params)
end
let(:existing_path) { 'files/ruby/popen.rb' }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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