diff --git a/src/api/Gemfile.lock b/src/api/Gemfile.lock index 339a330d8f3..dc54f81750a 100644 --- a/src/api/Gemfile.lock +++ b/src/api/Gemfile.lock @@ -410,7 +410,7 @@ GEM activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.7.0, < 2.0) - rubocop-rspec (2.7.0) + rubocop-rspec (2.8.0) rubocop (~> 1.19) ruby-ldap (0.9.20) ruby-progressbar (1.11.0) diff --git a/src/api/spec/support/shared_examples/features/beta/user_tab.rb b/src/api/spec/support/shared_examples/features/beta/user_tab.rb index d2cd137cce9..91b62b2f04d 100644 --- a/src/api/spec/support/shared_examples/features/beta/user_tab.rb +++ b/src/api/spec/support/shared_examples/features/beta/user_tab.rb @@ -28,7 +28,7 @@ click_link('Users') end - scenario 'Viewing user roles' do + it 'Viewing user roles' do skip_on_mobile expect(page).to have_text('User Roles') @@ -40,7 +40,7 @@ expect(page).to have_selector("a.remove-user[data-object='user_tab_user']") end - scenario 'Add non existent user' do + it 'Add non existent user' do add_user_link = page.find('a', text: 'Add User') page.scroll_to(add_user_link) add_user_link.click @@ -54,7 +54,7 @@ expect(page).to have_text("Couldn't find User with login = Jimmy") end - scenario 'Add an existing user' do + it 'Add an existing user' do add_user_link = page.find('a', text: 'Add User') page.scroll_to(add_user_link) add_user_link.click @@ -91,7 +91,7 @@ end end - scenario 'Remove user from package / project' do + it 'Remove user from package / project' do skip_on_mobile find('td', text: "#{reader.realname} (reader_user)").ancestor('tr').find('.remove-user').click @@ -102,7 +102,7 @@ expect(page).not_to have_css('a', text: "#{reader.realname} (reader_user)") end - scenario 'Add role to user' do + it 'Add role to user' do skip_on_mobile toggle_checkbox('user_reviewer_user_tab_user') @@ -112,7 +112,7 @@ expect(find_field('user_reviewer_user_tab_user', visible: false)).to be_checked end - scenario 'Remove role from user' do + it 'Remove role from user' do skip_on_mobile toggle_checkbox('user_bugowner_user_tab_user') @@ -141,7 +141,7 @@ click_link('Users') end - scenario 'Viewing group roles' do + it 'Viewing group roles' do skip_on_mobile expect(page).to have_text('Group Roles') @@ -153,7 +153,7 @@ expect(page).to have_selector("a.remove-group[data-object='existing_group']") end - scenario 'Add non existent group' do + it 'Add non existent group' do add_group_link = page.find('a', text: 'Add Group') page.scroll_to(add_group_link) add_group_link.click @@ -167,7 +167,7 @@ expect(page).to have_text("Couldn't find Group 'unknown group'") end - scenario 'Add an existing group' do + it 'Add an existing group' do add_group_link = page.find('a', text: 'Add Group') page.scroll_to(add_group_link) add_group_link.click @@ -203,7 +203,7 @@ end end - scenario 'Add role to group' do + it 'Add role to group' do skip_on_mobile toggle_checkbox('group_reviewer_existing_group') @@ -213,7 +213,7 @@ expect(find('#group_reviewer_existing_group', visible: false)).to be_checked end - scenario 'Remove role from group' do + it 'Remove role from group' do skip_on_mobile toggle_checkbox('group_bugowner_existing_group') diff --git a/src/api/spec/support/shared_examples/features/boostrap_flag_tables.rb b/src/api/spec/support/shared_examples/features/boostrap_flag_tables.rb index 7fd673e72de..16e180caf40 100644 --- a/src/api/spec/support/shared_examples/features/boostrap_flag_tables.rb +++ b/src/api/spec/support/shared_examples/features/boostrap_flag_tables.rb @@ -36,7 +36,7 @@ def css_locator_for(repository, architecture) let(:query_attributes) { { repo: nil, architecture_id: nil, flag: flag_type } } - scenario 'has correct table headers (arch labels)' do + it 'has correct table headers (arch labels)' do expect(subject.find('tr:first-child th:nth-child(1)').text).to eq('Repository') expect(subject.find('tr:first-child th:nth-child(2)').text).to eq('All') architectures.each do |arch| @@ -45,13 +45,13 @@ def css_locator_for(repository, architecture) end end - scenario 'has correct column descriptions (repository labels)' do + it 'has correct column descriptions (repository labels)' do expect(subject.find('thead th:first-child').text).to eq('Repository') expect(subject.find('tr:nth-child(1) td:first-child').text).to eq('All') expect(subject.find('tr:nth-child(2) td:first-child').text).to eq(repository.name) end - scenario 'toggle flags per repository' do + it 'toggle flags per repository' do query_attributes[:repo] = repository.name disable_flag_field_for(repository: repository.name, architecture: 'All') @@ -61,7 +61,7 @@ def css_locator_for(repository, architecture) expect(project.flags.where(query_attributes.merge(status: :enable))).to exist end - scenario 'toggle flags per arch' do + it 'toggle flags per arch' do query_attributes[:architecture_id] = Architecture.find_by_name('i586') disable_flag_field_for(repository: 'All', architecture: 'i586') @@ -71,7 +71,7 @@ def css_locator_for(repository, architecture) expect(project.flags.where(query_attributes.merge(status: :enable))).to exist end - scenario 'toggle all flags at once' do + it 'toggle all flags at once' do query_attributes[:flag] = flag_type disable_flag_field_for(repository: 'All', architecture: 'All') @@ -81,7 +81,7 @@ def css_locator_for(repository, architecture) expect(project.flags.where(query_attributes).pluck(:status)).to contain_exactly('enable') end - scenario 'toggle a single flag' do + it 'toggle a single flag' do query_attributes.merge!(repo: repository.name, architecture_id: Architecture.find_by_name('x86_64')) disable_flag_field_for(repository: repository.name, architecture: 'x86_64') diff --git a/src/api/spec/support/shared_examples/features/bootstrap_user_tab.rb b/src/api/spec/support/shared_examples/features/bootstrap_user_tab.rb index e00c919bf91..e693835b3b9 100644 --- a/src/api/spec/support/shared_examples/features/bootstrap_user_tab.rb +++ b/src/api/spec/support/shared_examples/features/bootstrap_user_tab.rb @@ -28,7 +28,7 @@ click_link('Users') end - scenario 'Viewing user roles' do + it 'Viewing user roles' do expect(page).to have_text('User Roles') expect(find_field('user_maintainer_user_tab_user', visible: false)).to be_checked expect(find_field('user_bugowner_user_tab_user', visible: false)).to be_checked @@ -38,7 +38,7 @@ expect(page).to have_selector("a.remove-user[data-object='user_tab_user']") end - scenario 'Add non existent user' do + it 'Add non existent user' do click_link('Add User') sleep 1 # FIXME: Needed to avoid a flickering test because the animation of the modal is sometimes faster than capybara @@ -50,7 +50,7 @@ expect(page).to have_text("Couldn't find User with login = Jimmy") end - scenario 'Add an existing user' do + it 'Add an existing user' do click_link('Add User') sleep 1 # FIXME: Needed to avoid a flickering test because the animation of the modal is sometimes faster than capybara @@ -83,7 +83,7 @@ end end - scenario 'Remove user from package / project' do + it 'Remove user from package / project' do find('td', text: "#{reader.realname} (reader_user)").ancestor('tr').find('.remove-user').click sleep 1 # FIXME: Needed to avoid a flickering test because the animation of the modal is sometimes faster than capybara click_button('Delete') @@ -92,7 +92,7 @@ expect(page).not_to have_css('a', text: "#{reader.realname} (reader_user)") end - scenario 'Add role to user' do + it 'Add role to user' do toggle_checkbox('user_reviewer_user_tab_user') visit project_path # project_users_path @@ -100,7 +100,7 @@ expect(find_field('user_reviewer_user_tab_user', visible: false)).to be_checked end - scenario 'Remove role from user' do + it 'Remove role from user' do toggle_checkbox('user_bugowner_user_tab_user') visit project_path @@ -127,7 +127,7 @@ click_link('Users') end - scenario 'Viewing group roles' do + it 'Viewing group roles' do expect(page).to have_text('Group Roles') expect(find_field('group_maintainer_existing_group', visible: false)).to be_checked expect(find_field('group_bugowner_existing_group', visible: false)).to be_checked @@ -137,7 +137,7 @@ expect(page).to have_selector("a.remove-group[data-object='existing_group']") end - scenario 'Add non existent group' do + it 'Add non existent group' do click_link('Add Group') sleep 1 # FIXME: Needed to avoid a flickering test because the animation of the modal is sometimes faster than capybara @@ -149,7 +149,7 @@ expect(page).to have_text("Couldn't find Group 'unknown group'") end - scenario 'Add an existing group' do + it 'Add an existing group' do click_link('Add Group') sleep 1 # FIXME: Needed to avoid a flickering test because the animation of the modal is sometimes faster than capybara @@ -181,7 +181,7 @@ end end - scenario 'Add role to group' do + it 'Add role to group' do toggle_checkbox('group_reviewer_existing_group') visit project_path @@ -189,7 +189,7 @@ expect(find('#group_reviewer_existing_group', visible: false)).to be_checked end - scenario 'Remove role from group' do + it 'Remove role from group' do toggle_checkbox('group_bugowner_existing_group') visit project_path diff --git a/src/api/spec/support/shared_examples/features/flags_tables.rb b/src/api/spec/support/shared_examples/features/flags_tables.rb index ea79359295a..fc78d558861 100644 --- a/src/api/spec/support/shared_examples/features/flags_tables.rb +++ b/src/api/spec/support/shared_examples/features/flags_tables.rb @@ -30,7 +30,7 @@ def css_locator_for(repository, architecture) # default attributes we are going to need to verify flags got updated let(:query_attributes) { { repo: nil, architecture_id: nil, flag: flag_type } } - scenario 'has correct table headers (arch labels)' do + it 'has correct table headers (arch labels)' do # Repository | All | $archs ... expect(subject.find('tr:first-child th:nth-child(1)').text).to eq('Repository') expect(subject.find('tr:first-child th:nth-child(2)').text).to eq('All') @@ -42,14 +42,14 @@ def css_locator_for(repository, architecture) end end - scenario 'has correct column descriptions (repository labels)' do + it 'has correct column descriptions (repository labels)' do # Repository | All | $repositories ... expect(subject.find('tr:nth-child(1) th:first-child').text).to eq('Repository') expect(subject.find('tr:nth-child(2) td:first-child').text).to eq('All') expect(subject.find('tr:nth-child(3) td:first-child').text).to eq(repository.name) end - scenario 'toggle flags per repository' do + it 'toggle flags per repository' do query_attributes[:repo] = repository.name disable_flag_field_for(repository: repository.name, architecture: 'All') @@ -59,7 +59,7 @@ def css_locator_for(repository, architecture) expect(project.flags.reload.where(query_attributes.merge(status: :enable))).to exist end - scenario 'toggle flags per arch' do + it 'toggle flags per arch' do query_attributes[:architecture_id] = Architecture.find_by_name('i586') disable_flag_field_for(repository: 'All', architecture: 'i586') @@ -69,7 +69,7 @@ def css_locator_for(repository, architecture) expect(project.flags.reload.where(query_attributes.merge(status: :enable))).to exist end - scenario 'toggle all flags at once' do + it 'toggle all flags at once' do query_attributes[:flag] = flag_type disable_flag_field_for(repository: 'All', architecture: 'All') @@ -79,7 +79,7 @@ def css_locator_for(repository, architecture) expect(project.flags.reload.where(query_attributes.merge(status: :enable))).to exist end - scenario 'toggle a single flag' do + it 'toggle a single flag' do query_attributes.merge!(repo: repository.name, architecture_id: Architecture.find_by_name('x86_64')) disable_flag_field_for(repository: repository.name, architecture: 'x86_64')