diff options
Diffstat (limited to 'spec/controllers/autocomplete_controller_spec.rb')
-rw-r--r-- | spec/controllers/autocomplete_controller_spec.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/controllers/autocomplete_controller_spec.rb b/spec/controllers/autocomplete_controller_spec.rb index 883bb35f396..4458a7223bf 100644 --- a/spec/controllers/autocomplete_controller_spec.rb +++ b/spec/controllers/autocomplete_controller_spec.rb @@ -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 |