summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/features/admin/admin_users_spec.rb14
-rw-r--r--spec/features/groups/members/list_members_spec.rb2
-rw-r--r--spec/features/groups/members/manage_members_spec.rb2
-rw-r--r--spec/features/projects/members/list_spec.rb2
-rw-r--r--spec/support/helpers/features/list_rows_helpers.rb (renamed from spec/support/helpers/features/rows_helpers.rb)5
5 files changed, 18 insertions, 7 deletions
diff --git a/spec/features/admin/admin_users_spec.rb b/spec/features/admin/admin_users_spec.rb
index 27f1d777274..931095936a6 100644
--- a/spec/features/admin/admin_users_spec.rb
+++ b/spec/features/admin/admin_users_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe "Admin::Users" do
- include Spec::Support::Helpers::Features::RowsHelpers
+ include Spec::Support::Helpers::Features::ListRowsHelpers
let!(:user) do
create(:omniauth_user, provider: 'twitter', extern_uid: '123456')
@@ -39,7 +39,7 @@ describe "Admin::Users" do
create(:user, name: 'Dmitriy')
end
- it 'search users by name' do
+ it 'searches users by name' do
visit admin_users_path(search_query: 'Foo')
expect(page).to have_content('Foo Bar')
@@ -65,6 +65,16 @@ describe "Admin::Users" do
expect(first_row.text).to include('Foo Bar')
expect(second_row.text).to include('Foo Baz')
end
+
+ it 'searches with respect of sorting' do
+ visit admin_users_path(sort: 'Name')
+
+ fill_in :search_query, with: 'Foo'
+ click_button('Search users')
+
+ expect(first_row.text).to include('Foo Bar')
+ expect(second_row.text).to include('Foo Baz')
+ end
end
describe 'Two-factor Authentication filters' do
diff --git a/spec/features/groups/members/list_members_spec.rb b/spec/features/groups/members/list_members_spec.rb
index 0df504f5324..4ba7161601e 100644
--- a/spec/features/groups/members/list_members_spec.rb
+++ b/spec/features/groups/members/list_members_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Groups > Members > List members' do
include Select2Helper
- include Spec::Support::Helpers::Features::RowsHelpers
+ include Spec::Support::Helpers::Features::ListRowsHelpers
let(:user1) { create(:user, name: 'John Doe') }
let(:user2) { create(:user, name: 'Mary Jane') }
diff --git a/spec/features/groups/members/manage_members_spec.rb b/spec/features/groups/members/manage_members_spec.rb
index 6da0312af2c..e2b4a491a13 100644
--- a/spec/features/groups/members/manage_members_spec.rb
+++ b/spec/features/groups/members/manage_members_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Groups > Members > Manage members' do
include Select2Helper
- include Spec::Support::Helpers::Features::RowsHelpers
+ include Spec::Support::Helpers::Features::ListRowsHelpers
let(:user1) { create(:user, name: 'John Doe') }
let(:user2) { create(:user, name: 'Mary Jane') }
diff --git a/spec/features/projects/members/list_spec.rb b/spec/features/projects/members/list_spec.rb
index b6f46a5544c..cf309492808 100644
--- a/spec/features/projects/members/list_spec.rb
+++ b/spec/features/projects/members/list_spec.rb
@@ -2,7 +2,7 @@ require 'spec_helper'
describe 'Project members list' do
include Select2Helper
- include Spec::Support::Helpers::Features::RowsHelpers
+ include Spec::Support::Helpers::Features::ListRowsHelpers
let(:user1) { create(:user, name: 'John Doe') }
let(:user2) { create(:user, name: 'Mary Jane') }
diff --git a/spec/support/helpers/features/rows_helpers.rb b/spec/support/helpers/features/list_rows_helpers.rb
index 5e614f40a24..0626415361c 100644
--- a/spec/support/helpers/features/rows_helpers.rb
+++ b/spec/support/helpers/features/list_rows_helpers.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
# These helpers allow you to access rows in the list
#
# Usage:
# describe "..." do
-# include Spec::Support::Helpers::Features::RowsHelpers
+# include Spec::Support::Helpers::Features::ListRowsHelpers
# ...
#
# expect(first_row.text).to include("John Doe")
@@ -12,7 +13,7 @@ module Spec
module Support
module Helpers
module Features
- module RowsHelpers
+ module ListRowsHelpers
def first_row
page.all('ul.content-list > li')[0]
end