diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/features/groups | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/features/groups')
-rw-r--r-- | spec/features/groups/clusters/eks_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/groups/clusters/user_spec.rb | 3 | ||||
-rw-r--r-- | spec/features/groups/group_runners_spec.rb | 168 | ||||
-rw-r--r-- | spec/features/groups/import_export/export_file_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/groups/members/manage_groups_spec.rb | 149 | ||||
-rw-r--r-- | spec/features/groups/members/manage_members_spec.rb | 139 | ||||
-rw-r--r-- | spec/features/groups/members/sort_members_spec.rb | 40 | ||||
-rw-r--r-- | spec/features/groups/milestone_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/groups/milestones_sorting_spec.rb | 14 | ||||
-rw-r--r-- | spec/features/groups/settings/ci_cd_spec.rb | 81 |
10 files changed, 449 insertions, 167 deletions
diff --git a/spec/features/groups/clusters/eks_spec.rb b/spec/features/groups/clusters/eks_spec.rb index 3cca2d0919c..0e64a2faf3e 100644 --- a/spec/features/groups/clusters/eks_spec.rb +++ b/spec/features/groups/clusters/eks_spec.rb @@ -20,8 +20,8 @@ RSpec.describe 'Group AWS EKS Cluster', :js do before do visit group_clusters_path(group) - click_button 'Actions' - click_link 'Create a new cluster' + click_button(class: 'dropdown-toggle-split') + click_link 'Create a cluster (deprecated)' end context 'when user creates a cluster on AWS EKS' do diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb index 2ed6ddc09ab..74ea72b238f 100644 --- a/spec/features/groups/clusters/user_spec.rb +++ b/spec/features/groups/clusters/user_spec.rb @@ -25,7 +25,7 @@ RSpec.describe 'User Cluster', :js do before do visit group_clusters_path(group) - click_link 'Connect with a certificate' + click_link 'Connect a cluster (deprecated)' end context 'when user filled form with valid parameters' do @@ -119,7 +119,6 @@ RSpec.describe 'User Cluster', :js do it 'user sees creation form with the successful message' do expect(page).to have_content('Kubernetes cluster integration was successfully removed.') - expect(page).to have_link('Connect with a certificate') end end end diff --git a/spec/features/groups/group_runners_spec.rb b/spec/features/groups/group_runners_spec.rb new file mode 100644 index 00000000000..1d821edefa3 --- /dev/null +++ b/spec/features/groups/group_runners_spec.rb @@ -0,0 +1,168 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe "Group Runners" do + include Spec::Support::Helpers::Features::RunnersHelpers + + let_it_be(:group_owner) { create(:user) } + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, group: group) } + + before do + group.add_owner(group_owner) + sign_in(group_owner) + end + + describe "Group runners page", :js do + let!(:group_registration_token) { group.runners_token } + + context "runners registration" do + before do + visit group_runners_path(group) + end + + it_behaves_like "shows and resets runner registration token" do + let(:dropdown_text) { 'Register a group runner' } + let(:registration_token) { group_registration_token } + end + end + + context "with no runners" do + before do + visit group_runners_path(group) + end + + it_behaves_like "shows no runners" + + it 'shows tabs with total counts equal to 0' do + expect(page).to have_link('All 0') + expect(page).to have_link('Group 0') + expect(page).to have_link('Project 0') + end + end + + context "with an online group runner" do + let!(:group_runner) do + create(:ci_runner, :group, groups: [group], description: 'runner-foo', contacted_at: Time.zone.now) + end + + before do + visit group_runners_path(group) + end + + it_behaves_like 'shows runner in list' do + let(:runner) { group_runner } + end + + it_behaves_like 'pauses, resumes and deletes a runner' do + let(:runner) { group_runner } + end + + it 'shows a group badge' do + within_runner_row(group_runner.id) do + expect(page).to have_selector '.badge', text: 'group' + end + end + + it 'can edit runner information' do + within_runner_row(group_runner.id) do + expect(find_link('Edit')[:href]).to end_with(edit_group_runner_path(group, group_runner)) + end + end + end + + context "with an online project runner" do + let!(:project_runner) do + create(:ci_runner, :project, projects: [project], description: 'runner-bar', contacted_at: Time.zone.now) + end + + before do + visit group_runners_path(group) + end + + it_behaves_like 'shows runner in list' do + let(:runner) { project_runner } + end + + it_behaves_like 'pauses, resumes and deletes a runner' do + let(:runner) { project_runner } + end + + it 'shows a project (specific) badge' do + within_runner_row(project_runner.id) do + expect(page).to have_selector '.badge', text: 'specific' + end + end + + it 'can edit runner information' do + within_runner_row(project_runner.id) do + expect(find_link('Edit')[:href]).to end_with(edit_group_runner_path(group, project_runner)) + end + end + end + + context 'with a multi-project runner' do + let(:project) { create(:project, group: group) } + let(:project_2) { create(:project, group: group) } + let!(:runner) { create(:ci_runner, :project, projects: [project, project_2], description: 'group-runner') } + + it 'user cannot remove the project runner' do + visit group_runners_path(group) + + within_runner_row(runner.id) do + expect(page).to have_button 'Delete runner', disabled: true + end + end + end + + context 'filtered search' do + before do + visit group_runners_path(group) + end + + it 'allows user to search by paused and status', :js do + focus_filtered_search + + page.within(search_bar_selector) do + expect(page).to have_link('Paused') + expect(page).to have_content('Status') + end + end + end + end + + describe "Group runner edit page", :js do + let!(:runner) do + create(:ci_runner, :group, groups: [group], description: 'runner-foo', contacted_at: Time.zone.now) + end + + it 'user edits the runner to be protected' do + visit edit_group_runner_path(group, runner) + + expect(page.find_field('runner[access_level]')).not_to be_checked + + check 'runner_access_level' + click_button 'Save changes' + + expect(page).to have_content 'Protected Yes' + end + + context 'when a runner has a tag' do + before do + runner.update!(tag_list: ['tag']) + end + + it 'user edits runner not to run untagged jobs' do + visit edit_group_runner_path(group, runner) + + expect(page.find_field('runner[run_untagged]')).to be_checked + + uncheck 'runner_run_untagged' + click_button 'Save changes' + + expect(page).to have_content 'Can run untagged jobs No' + end + end + end +end diff --git a/spec/features/groups/import_export/export_file_spec.rb b/spec/features/groups/import_export/export_file_spec.rb index 9feb8085e66..e3cb1ad77a7 100644 --- a/spec/features/groups/import_export/export_file_spec.rb +++ b/spec/features/groups/import_export/export_file_spec.rb @@ -26,22 +26,6 @@ RSpec.describe 'Group Export', :js do end end - context 'when the group import/export FF is disabled' do - before do - stub_feature_flags(group_import_export: false) - - group.add_owner(user) - sign_in(user) - end - - it 'does not show the group export options' do - visit edit_group_path(group) - - expect(page).to have_content('Advanced') - expect(page).not_to have_content('Export group') - end - end - context 'when the signed in user does not have the required permission level' do before do group.add_guest(user) diff --git a/spec/features/groups/members/manage_groups_spec.rb b/spec/features/groups/members/manage_groups_spec.rb index 5ab5a7ea716..5a9223d9ee8 100644 --- a/spec/features/groups/members/manage_groups_spec.rb +++ b/spec/features/groups/members/manage_groups_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Manage groups', :js do - include Select2Helper include Spec::Support::Helpers::Features::MembersHelpers include Spec::Support::Helpers::Features::InviteMembersModalHelper include Spec::Support::Helpers::ModalHelpers @@ -119,16 +118,92 @@ RSpec.describe 'Groups > Members > Manage groups', :js do describe 'group search results' do let_it_be(:group, refind: true) { create(:group) } - let_it_be(:group_within_hierarchy) { create(:group, parent: group) } - let_it_be(:group_outside_hierarchy) { create(:group) } - before_all do - group.add_owner(user) - group_within_hierarchy.add_owner(user) - group_outside_hierarchy.add_owner(user) + context 'with instance admin considerations' do + let_it_be(:group_to_share) { create(:group) } + + context 'when user is an admin' do + let_it_be(:admin) { create(:admin) } + + before do + sign_in(admin) + gitlab_enable_admin_mode_sign_in(admin) + end + + it 'shows groups where the admin has no direct membership' do + visit group_group_members_path(group) + + click_on 'Invite a group' + click_on 'Select a group' + wait_for_requests + + page.within(group_dropdown_selector) do + expect_to_have_group(group_to_share) + expect_not_to_have_group(group) + end + end + + it 'shows groups where the admin has at least guest level membership' do + group_to_share.add_guest(admin) + + visit group_group_members_path(group) + + click_on 'Invite a group' + click_on 'Select a group' + wait_for_requests + + page.within(group_dropdown_selector) do + expect_to_have_group(group_to_share) + expect_not_to_have_group(group) + end + end + end + + context 'when user is not an admin' do + before do + group.add_owner(user) + end + + it 'shows groups where the user has no direct membership' do + visit group_group_members_path(group) + + click_on 'Invite a group' + click_on 'Select a group' + wait_for_requests + + page.within(group_dropdown_selector) do + expect_not_to_have_group(group_to_share) + expect_not_to_have_group(group) + end + end + + it 'shows groups where the user has at least guest level membership' do + group_to_share.add_guest(user) + + visit group_group_members_path(group) + + click_on 'Invite a group' + click_on 'Select a group' + wait_for_requests + + page.within(group_dropdown_selector) do + expect_to_have_group(group_to_share) + expect_not_to_have_group(group) + end + end + end end - context 'when the invite members group modal is enabled' do + context 'when user is not an admin and there are hierarchy considerations' do + let_it_be(:group_within_hierarchy) { create(:group, parent: group) } + let_it_be(:group_outside_hierarchy) { create(:group) } + + before_all do + group.add_owner(user) + group_within_hierarchy.add_owner(user) + group_outside_hierarchy.add_owner(user) + end + it 'does not show self or ancestors', :aggregate_failures do group_sibbling = create(:group, parent: group) group_sibbling.add_owner(user) @@ -139,46 +214,46 @@ RSpec.describe 'Groups > Members > Manage groups', :js do click_on 'Select a group' wait_for_requests - page.within('[data-testid="group-select-dropdown"]') do - expect(page).to have_selector("[entity-id='#{group_outside_hierarchy.id}']") - expect(page).to have_selector("[entity-id='#{group_sibbling.id}']") - expect(page).not_to have_selector("[entity-id='#{group.id}']") - expect(page).not_to have_selector("[entity-id='#{group_within_hierarchy.id}']") + page.within(group_dropdown_selector) do + expect_to_have_group(group_outside_hierarchy) + expect_to_have_group(group_sibbling) + expect_not_to_have_group(group) + expect_not_to_have_group(group_within_hierarchy) end end - end - context 'when sharing with groups outside the hierarchy is enabled' do - it 'shows groups within and outside the hierarchy in search results' do - visit group_group_members_path(group) + context 'when sharing with groups outside the hierarchy is enabled' do + it 'shows groups within and outside the hierarchy in search results' do + visit group_group_members_path(group) - click_on 'Invite a group' - click_on 'Select a group' + click_on 'Invite a group' + click_on 'Select a group' + wait_for_requests - expect(page).to have_text group_within_hierarchy.name - expect(page).to have_text group_outside_hierarchy.name + page.within(group_dropdown_selector) do + expect_to_have_group(group_within_hierarchy) + expect_to_have_group(group_outside_hierarchy) + end + end end - end - context 'when sharing with groups outside the hierarchy is disabled' do - before do - group.namespace_settings.update!(prevent_sharing_groups_outside_hierarchy: true) - end + context 'when sharing with groups outside the hierarchy is disabled' do + before do + group.namespace_settings.update!(prevent_sharing_groups_outside_hierarchy: true) + end - it 'shows only groups within the hierarchy in search results' do - visit group_group_members_path(group) + it 'shows only groups within the hierarchy in search results' do + visit group_group_members_path(group) - click_on 'Invite a group' - click_on 'Select a group' + click_on 'Invite a group' + click_on 'Select a group' - expect(page).to have_text group_within_hierarchy.name - expect(page).not_to have_text group_outside_hierarchy.name + page.within(group_dropdown_selector) do + expect_to_have_group(group_within_hierarchy) + expect_not_to_have_group(group_outside_hierarchy) + end + end end end end - - def click_groups_tab - expect(page).to have_link 'Groups' - click_link "Groups" - end end diff --git a/spec/features/groups/members/manage_members_spec.rb b/spec/features/groups/members/manage_members_spec.rb index 533d2118b30..468001c3be6 100644 --- a/spec/features/groups/members/manage_members_spec.rb +++ b/spec/features/groups/members/manage_members_spec.rb @@ -42,46 +42,6 @@ RSpec.describe 'Groups > Members > Manage members' do end end - it 'add user to group', :js, :snowplow, :aggregate_failures do - group.add_owner(user1) - - visit group_group_members_path(group) - - invite_member(user2.name, role: 'Reporter') - - page.within(second_row) do - expect(page).to have_content(user2.name) - expect(page).to have_button('Reporter') - end - - expect_snowplow_event( - category: 'Members::CreateService', - action: 'create_member', - label: 'group-members-page', - property: 'existing_user', - user: user1 - ) - end - - it 'do not disclose email addresses', :js do - group.add_owner(user1) - create(:user, email: 'undisclosed_email@gitlab.com', name: "Jane 'invisible' Doe") - - visit group_group_members_path(group) - - click_on 'Invite members' - find('[data-testid="members-token-select-input"]').set('@gitlab.com') - - wait_for_requests - - expect(page).to have_content('No matches found') - - find('[data-testid="members-token-select-input"]').set('undisclosed_email@gitlab.com') - wait_for_requests - - expect(page).to have_content('Invite "undisclosed_email@gitlab.com" by email') - end - it 'remove user from group', :js do group.add_owner(user1) group.add_developer(user2) @@ -106,43 +66,29 @@ RSpec.describe 'Groups > Members > Manage members' do end end - it 'add yourself to group when already an owner', :js, :aggregate_failures do - group.add_owner(user1) - - visit group_group_members_path(group) - - invite_member(user1.name, role: 'Reporter') - - page.within(first_row) do - expect(page).to have_content(user1.name) - expect(page).to have_content('Owner') - end - end + context 'when inviting' do + it 'add yourself to group when already an owner', :js do + group.add_owner(user1) - it 'invite user to group', :js, :snowplow do - group.add_owner(user1) + visit group_group_members_path(group) - visit group_group_members_path(group) + invite_member(user1.name, role: 'Reporter', refresh: false) - invite_member('test@example.com', role: 'Reporter') + expect(page).to have_selector(invite_modal_selector) + expect(page).to have_content("not authorized to update member") - expect(page).to have_link 'Invited' - click_link 'Invited' + page.refresh - aggregate_failures do - page.within(members_table) do - expect(page).to have_content('test@example.com') - expect(page).to have_content('Invited') - expect(page).to have_button('Reporter') + page.within find_member_row(user1) do + expect(page).to have_content('Owner') end + end - expect_snowplow_event( - category: 'Members::InviteService', - action: 'create_member', - label: 'group-members-page', - property: 'net_new_user', - user: user1 - ) + it_behaves_like 'inviting members', 'group-members-page' do + let_it_be(:entity) { group } + let_it_be(:members_page_path) { group_group_members_path(entity) } + let_it_be(:subentity) { create(:group, parent: group) } + let_it_be(:subentity_members_page_path) { group_group_members_path(subentity) } end end @@ -169,4 +115,57 @@ RSpec.describe 'Groups > Members > Manage members' do end end end + + describe 'member search results', :js do + before do + group.add_owner(user1) + end + + it 'does not disclose email addresses' do + create(:user, email: 'undisclosed_email@gitlab.com', name: "Jane 'invisible' Doe") + + visit group_group_members_path(group) + + click_on 'Invite members' + find(member_dropdown_selector).set('@gitlab.com') + + wait_for_requests + + expect(page).to have_content('No matches found') + + find(member_dropdown_selector).set('undisclosed_email@gitlab.com') + wait_for_requests + + expect(page).to have_content('Invite "undisclosed_email@gitlab.com" by email') + end + + it 'does not show project_bots', :aggregate_failures do + internal_project_bot = create(:user, :project_bot, name: '_internal_project_bot_') + project = create(:project, group: group) + project.add_maintainer(internal_project_bot) + + external_group = create(:group) + external_project_bot = create(:user, :project_bot, name: '_external_project_bot_') + external_project = create(:project, group: external_group) + external_project.add_maintainer(external_project_bot) + external_project.add_maintainer(user1) + + visit group_group_members_path(group) + + click_on 'Invite members' + + page.within invite_modal_selector do + field = find(member_dropdown_selector) + field.native.send_keys :tab + field.click + + wait_for_requests + + expect(page).to have_content(user1.name) + expect(page).to have_content(user2.name) + expect(page).not_to have_content(internal_project_bot.name) + expect(page).not_to have_content(external_project_bot.name) + end + end + end end diff --git a/spec/features/groups/members/sort_members_spec.rb b/spec/features/groups/members/sort_members_spec.rb index 03758e0d401..bf8e64fa1e2 100644 --- a/spec/features/groups/members/sort_members_spec.rb +++ b/spec/features/groups/members/sort_members_spec.rb @@ -5,8 +5,8 @@ require 'spec_helper' RSpec.describe 'Groups > Members > Sort members', :js do include Spec::Support::Helpers::Features::MembersHelpers - let(:owner) { create(:user, name: 'John Doe') } - let(:developer) { create(:user, name: 'Mary Jane', last_sign_in_at: 5.days.ago) } + let(:owner) { create(:user, name: 'John Doe', created_at: 5.days.ago, last_activity_on: Date.today) } + let(:developer) { create(:user, name: 'Mary Jane', created_at: 1.day.ago, last_sign_in_at: 5.days.ago, last_activity_on: Date.today - 5) } let(:group) { create(:group) } before do @@ -50,6 +50,42 @@ RSpec.describe 'Groups > Members > Sort members', :js do expect_sort_by('Max role', :desc) end + it 'sorts by user created on ascending' do + visit_members_list(sort: :oldest_created_user) + + expect(first_row.text).to include(owner.name) + expect(second_row.text).to include(developer.name) + + expect_sort_by('Created on', :asc) + end + + it 'sorts by user created on descending' do + visit_members_list(sort: :recent_created_user) + + expect(first_row.text).to include(developer.name) + expect(second_row.text).to include(owner.name) + + expect_sort_by('Created on', :desc) + end + + it 'sorts by last activity ascending' do + visit_members_list(sort: :oldest_last_activity) + + expect(first_row.text).to include(developer.name) + expect(second_row.text).to include(owner.name) + + expect_sort_by('Last activity', :asc) + end + + it 'sorts by last activity descending' do + visit_members_list(sort: :recent_last_activity) + + expect(first_row.text).to include(owner.name) + expect(second_row.text).to include(developer.name) + + expect_sort_by('Last activity', :desc) + end + it 'sorts by access granted ascending' do visit_members_list(sort: :last_joined) diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb index 4edf27e8fa4..42eaa8358a1 100644 --- a/spec/features/groups/milestone_spec.rb +++ b/spec/features/groups/milestone_spec.rb @@ -66,7 +66,7 @@ RSpec.describe 'Group milestones' do context 'when no milestones' do it 'renders no milestones text' do visit group_milestones_path(group) - expect(page).to have_content('No milestones to show') + expect(page).to have_content('Use milestones to track issues and merge requests') end end diff --git a/spec/features/groups/milestones_sorting_spec.rb b/spec/features/groups/milestones_sorting_spec.rb index a06e64fdee0..22d7ff91d41 100644 --- a/spec/features/groups/milestones_sorting_spec.rb +++ b/spec/features/groups/milestones_sorting_spec.rb @@ -17,7 +17,7 @@ RSpec.describe 'Milestones sorting', :js do sign_in(user) end - it 'visit group milestones and sort by due_date_asc' do + it 'visit group milestones and sort by due_date_asc', :js do visit group_milestones_path(group) expect(page).to have_button('Due soon') @@ -27,13 +27,13 @@ RSpec.describe 'Milestones sorting', :js do expect(page.all('ul.content-list > li strong > a').map(&:text)).to eq(['v2.0', 'v2.0', 'v3.0', 'v1.0', 'v1.0']) end - click_button 'Due soon' + within '[data-testid=milestone_sort_by_dropdown]' do + click_button 'Due soon' + expect(find('.gl-new-dropdown-contents').all('.gl-new-dropdown-item-text-wrapper p').map(&:text)).to eq(['Due soon', 'Due later', 'Start soon', 'Start later', 'Name, ascending', 'Name, descending']) - expect(find('ul.dropdown-menu-sort li').all('a').map(&:text)).to eq(['Due soon', 'Due later', 'Start soon', 'Start later', 'Name, ascending', 'Name, descending']) - - click_link 'Due later' - - expect(page).to have_button('Due later') + click_button 'Due later' + expect(page).to have_button('Due later') + end # assert descending sorting within '.milestones' do diff --git a/spec/features/groups/settings/ci_cd_spec.rb b/spec/features/groups/settings/ci_cd_spec.rb index 8851aeb6381..c5ad524e647 100644 --- a/spec/features/groups/settings/ci_cd_spec.rb +++ b/spec/features/groups/settings/ci_cd_spec.rb @@ -5,52 +5,73 @@ require 'spec_helper' RSpec.describe 'Group CI/CD settings' do include WaitForRequests - let(:user) { create(:user) } - let(:group) { create(:group) } + let_it_be(:user) { create(:user) } + let_it_be(:group, reload: true) { create(:group) } - before do + before_all do group.add_owner(user) + end + + before do sign_in(user) end - describe 'new group runners view banner' do - it 'displays banner' do - visit group_settings_ci_cd_path(group) + describe 'Runners section' do + let(:shared_runners_toggle) { page.find('[data-testid="enable-runners-toggle"]') } + + context 'with runner_list_group_view_vue_ui enabled' do + before do + visit group_settings_ci_cd_path(group) + end + + it 'displays the new group runners view banner' do + expect(page).to have_content(s_('Runners|New group runners view')) + expect(page).to have_link(href: group_runners_path(group)) + end - expect(page).to have_content(s_('Runners|New group runners view')) - expect(page).to have_link(href: group_runners_path(group)) + it 'has "Enable shared runners for this group" toggle', :js do + expect(shared_runners_toggle).to have_content(_('Enable shared runners for this group')) + end end - it 'does not display banner' do - stub_feature_flags(runner_list_group_view_vue_ui: false) + context 'with runner_list_group_view_vue_ui disabled' do + before do + stub_feature_flags(runner_list_group_view_vue_ui: false) - visit group_settings_ci_cd_path(group) + visit group_settings_ci_cd_path(group) + end - expect(page).not_to have_content(s_('Runners|New group runners view')) - expect(page).not_to have_link(href: group_runners_path(group)) - end - end + it 'does not display the new group runners view banner' do + expect(page).not_to have_content(s_('Runners|New group runners view')) + expect(page).not_to have_link(href: group_runners_path(group)) + end - describe 'runners registration token' do - let!(:token) { group.runners_token } + it 'has "Enable shared runners for this group" toggle', :js do + expect(shared_runners_toggle).to have_content(_('Enable shared runners for this group')) + end - before do - visit group_settings_ci_cd_path(group) - end + context 'with runners registration token' do + let!(:token) { group.runners_token } - it 'has a registration token' do - expect(page.find('#registration_token')).to have_content(token) - end + before do + visit group_settings_ci_cd_path(group) + end - describe 'reload registration token' do - let(:page_token) { find('#registration_token').text } + it 'displays the registration token' do + expect(page.find('#registration_token')).to have_content(token) + end - before do - click_button 'Reset registration token' - end + describe 'reload registration token' do + let(:page_token) { find('#registration_token').text } + + before do + click_button 'Reset registration token' + end - it 'changes registration token' do - expect(page_token).not_to eq token + it 'changes the registration token' do + expect(page_token).not_to eq token + end + end end end end |