summaryrefslogtreecommitdiff
path: root/spec/support/helpers/features/sorting_helpers.rb
blob: 50457b647455b5d14fcc2c5d9bc0d1cfc12c2e92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# These helpers allow you to manipulate with sorting features.
#
# Usage:
#   describe "..." do
#     include Spec::Support::Helpers::Features::SortingHelpers
#     ...
#
#     sort_by("Last updated")
#
module Spec
  module Support
    module Helpers
      module Features
        module SortingHelpers
          def sort_by(value)
            find('button.dropdown-toggle').click

            page.within('.content ul.dropdown-menu.dropdown-menu-align-right li') do
              click_link(value)
            end
          end
        end
      end
    end
  end
end