Commit ecea127c authored by Nur Rony's avatar Nur Rony Committed by Douglas Barbosa Alexandre

Improve test for sort dropdown on members page

parent eac34fd9
.dropdown.inline .dropdown.inline.member-sort-dropdown
= dropdown_toggle(member_sort_options_hash[@sort], { toggle: 'dropdown' }) = dropdown_toggle(member_sort_options_hash[@sort], { toggle: 'dropdown' })
%ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable %ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
%li.dropdown-header %li.dropdown-header
......
...@@ -17,6 +17,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -17,6 +17,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end end
scenario 'sorts by access level ascending' do scenario 'sorts by access level ascending' do
...@@ -24,6 +25,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -24,6 +25,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(owner.name) expect(second_member).to include(owner.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, ascending')
end end
scenario 'sorts by access level descending' do scenario 'sorts by access level descending' do
...@@ -31,6 +33,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -31,6 +33,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, descending')
end end
scenario 'sorts by last joined' do scenario 'sorts by last joined' do
...@@ -38,6 +41,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -38,6 +41,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(owner.name) expect(second_member).to include(owner.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Last joined')
end end
scenario 'sorts by oldest joined' do scenario 'sorts by oldest joined' do
...@@ -45,6 +49,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -45,6 +49,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest joined')
end end
scenario 'sorts by name ascending' do scenario 'sorts by name ascending' do
...@@ -52,6 +57,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -52,6 +57,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end end
scenario 'sorts by name descending' do scenario 'sorts by name descending' do
...@@ -59,6 +65,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -59,6 +65,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(owner.name) expect(second_member).to include(owner.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending')
end end
scenario 'sorts by recent sign in' do scenario 'sorts by recent sign in' do
...@@ -66,6 +73,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -66,6 +73,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(owner.name) expect(first_member).to include(owner.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Recent sign in')
end end
scenario 'sorts by oldest sign in' do scenario 'sorts by oldest sign in' do
...@@ -73,6 +81,7 @@ feature 'Groups > Members > Sorting', feature: true do ...@@ -73,6 +81,7 @@ feature 'Groups > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(owner.name) expect(second_member).to include(owner.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest sign in')
end end
def visit_members_list(sort:) def visit_members_list(sort:)
......
...@@ -17,6 +17,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -17,6 +17,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(master.name) expect(first_member).to include(master.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end end
scenario 'sorts by access level ascending' do scenario 'sorts by access level ascending' do
...@@ -24,6 +25,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -24,6 +25,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(master.name) expect(second_member).to include(master.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, ascending')
end end
scenario 'sorts by access level descending' do scenario 'sorts by access level descending' do
...@@ -31,6 +33,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -31,6 +33,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(master.name) expect(first_member).to include(master.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Access level, descending')
end end
scenario 'sorts by last joined' do scenario 'sorts by last joined' do
...@@ -38,6 +41,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -38,6 +41,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(master.name) expect(second_member).to include(master.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Last joined')
end end
scenario 'sorts by oldest joined' do scenario 'sorts by oldest joined' do
...@@ -45,6 +49,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -45,6 +49,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(master.name) expect(first_member).to include(master.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest joined')
end end
scenario 'sorts by name ascending' do scenario 'sorts by name ascending' do
...@@ -52,6 +57,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -52,6 +57,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(master.name) expect(first_member).to include(master.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, ascending')
end end
scenario 'sorts by name descending' do scenario 'sorts by name descending' do
...@@ -59,6 +65,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -59,6 +65,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(master.name) expect(second_member).to include(master.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Name, descending')
end end
scenario 'sorts by recent sign in' do scenario 'sorts by recent sign in' do
...@@ -66,6 +73,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -66,6 +73,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(master.name) expect(first_member).to include(master.name)
expect(second_member).to include(developer.name) expect(second_member).to include(developer.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Recent sign in')
end end
scenario 'sorts by oldest sign in' do scenario 'sorts by oldest sign in' do
...@@ -73,6 +81,7 @@ feature 'Projects > Members > Sorting', feature: true do ...@@ -73,6 +81,7 @@ feature 'Projects > Members > Sorting', feature: true do
expect(first_member).to include(developer.name) expect(first_member).to include(developer.name)
expect(second_member).to include(master.name) expect(second_member).to include(master.name)
expect(page).to have_css('.member-sort-dropdown .dropdown-toggle-text', text: 'Oldest sign in')
end end
def visit_members_list(sort:) def visit_members_list(sort:)
......
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