Commit 465f95a8 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix broken rspec tests

parent 873d60d5
...@@ -2,7 +2,8 @@ import Api from './api'; ...@@ -2,7 +2,8 @@ import Api from './api';
import { normalizeCRLFHeaders } from './lib/utils/common_utils'; import { normalizeCRLFHeaders } from './lib/utils/common_utils';
export default function groupsSelect() { export default function groupsSelect() {
const PER_PAGE = 20; // Needs to be accessible in rspec
window.GROUP_SELECT_PER_PAGE = 20;
$('.ajax-groups-select').each(function setAjaxGroupsSelect2() { $('.ajax-groups-select').each(function setAjaxGroupsSelect2() {
const $select = $(this); const $select = $(this);
const allAvailable = $select.data('all-available'); const allAvailable = $select.data('all-available');
...@@ -16,8 +17,7 @@ export default function groupsSelect() { ...@@ -16,8 +17,7 @@ export default function groupsSelect() {
dataType: 'json', dataType: 'json',
quietMillis: 250, quietMillis: 250,
transport(params) { transport(params) {
// eslint-disable-next-line promise/catch-or-return return $.ajax(params)
$.ajax(params)
.then((data, status, xhr) => { .then((data, status, xhr) => {
const results = data || []; const results = data || [];
...@@ -40,7 +40,7 @@ export default function groupsSelect() { ...@@ -40,7 +40,7 @@ export default function groupsSelect() {
return { return {
search, search,
page, page,
per_page: PER_PAGE, per_page: window.GROUP_SELECT_PER_PAGE,
all_available: allAvailable, all_available: allAvailable,
}; };
}, },
......
...@@ -149,7 +149,7 @@ feature 'Project > Members > Share with Group', :js do ...@@ -149,7 +149,7 @@ feature 'Project > Members > Share with Group', :js do
create(:group).add_owner(master) create(:group).add_owner(master)
visit project_settings_members_path(project) visit project_settings_members_path(project)
execute_script 'GroupsSelect.PER_PAGE = 1;' execute_script 'GROUP_SELECT_PER_PAGE = 1;'
open_select2 '#link_group_id' open_select2 '#link_group_id'
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment