diff options
author | Sean McGivern <sean@gitlab.com> | 2018-07-09 17:23:30 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-07-09 17:23:30 +0100 |
commit | 2a4039cf668c23156d49eae7f84837fb527f2549 (patch) | |
tree | 7add56decfeff4220bce9a840f700bffd98f395c /spec/features | |
parent | ab3c91a702a6a38374d574488ba4841758842505 (diff) | |
parent | 72c99b58abe7bbc956804c9d403689e64f579d3e (diff) | |
download | gitlab-ce-2a4039cf668c23156d49eae7f84837fb527f2549.tar.gz |
Merge branch 'update-rubocop'
Diffstat (limited to 'spec/features')
15 files changed, 23 insertions, 26 deletions
diff --git a/spec/features/commits_spec.rb b/spec/features/commits_spec.rb index 87fa3f60826..29fcf89fa7a 100644 --- a/spec/features/commits_spec.rb +++ b/spec/features/commits_spec.rb @@ -89,7 +89,7 @@ describe 'Commits' do context 'Download artifacts' do before do - build.update_attributes(legacy_artifacts_file: artifacts_file) + build.update(legacy_artifacts_file: artifacts_file) end it do @@ -146,7 +146,7 @@ describe 'Commits' do context "when logged as reporter" do before do project.add_reporter(user) - build.update_attributes(legacy_artifacts_file: artifacts_file) + build.update(legacy_artifacts_file: artifacts_file) visit pipeline_path(pipeline) end @@ -168,7 +168,7 @@ describe 'Commits' do project.update( visibility_level: Gitlab::VisibilityLevel::INTERNAL, public_builds: false) - build.update_attributes(legacy_artifacts_file: artifacts_file) + build.update(legacy_artifacts_file: artifacts_file) visit pipeline_path(pipeline) end diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 8647616101b..4daacc61d85 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -59,7 +59,7 @@ describe 'Dashboard Projects' do context 'when last_repository_updated_at, last_activity_at and update_at are present' do it 'shows the last_repository_updated_at attribute as the update date' do - project.update_attributes!(last_repository_updated_at: Time.now, last_activity_at: 1.hour.ago) + project.update!(last_repository_updated_at: Time.now, last_activity_at: 1.hour.ago) visit dashboard_projects_path @@ -67,7 +67,7 @@ describe 'Dashboard Projects' do end it 'shows the last_activity_at attribute as the update date' do - project.update_attributes!(last_repository_updated_at: 1.hour.ago, last_activity_at: Time.now) + project.update!(last_repository_updated_at: 1.hour.ago, last_activity_at: Time.now) visit dashboard_projects_path @@ -77,7 +77,7 @@ describe 'Dashboard Projects' do context 'when last_repository_updated_at and last_activity_at are missing' do it 'shows the updated_at attribute as the update date' do - project.update_attributes!(last_repository_updated_at: nil, last_activity_at: nil) + project.update!(last_repository_updated_at: nil, last_activity_at: nil) project.touch visit dashboard_projects_path diff --git a/spec/features/groups/members/request_access_spec.rb b/spec/features/groups/members/request_access_spec.rb index 1c833c36a61..94510f917a3 100644 --- a/spec/features/groups/members/request_access_spec.rb +++ b/spec/features/groups/members/request_access_spec.rb @@ -13,7 +13,7 @@ describe 'Groups > Members > Request access' do end it 'request access feature is disabled' do - group.update_attributes(request_access_enabled: false) + group.update(request_access_enabled: false) visit group_path(group) expect(page).not_to have_content 'Request Access' diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index b4cb3835a13..3050f23c130 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -112,7 +112,7 @@ describe 'Issue Sidebar' do context 'editing issue labels', :js do before do - issue.update_attributes(labels: [label]) + issue.update(labels: [label]) page.within('.block.labels') do find('.edit-link').click end diff --git a/spec/features/merge_request/user_posts_diff_notes_spec.rb b/spec/features/merge_request/user_posts_diff_notes_spec.rb index 13cc5f256eb..02d19db3828 100644 --- a/spec/features/merge_request/user_posts_diff_notes_spec.rb +++ b/spec/features/merge_request/user_posts_diff_notes_spec.rb @@ -198,7 +198,7 @@ describe 'Merge request > User posts diff notes', :js do context 'when the MR only supports legacy diff notes' do before do - merge_request.merge_request_diff.update_attributes(start_commit_sha: nil) + merge_request.merge_request_diff.update(start_commit_sha: nil) visit diffs_project_merge_request_path(project, merge_request, view: 'inline') end diff --git a/spec/features/profiles/password_spec.rb b/spec/features/profiles/password_spec.rb index f9c6ff90ca1..5e3569e4beb 100644 --- a/spec/features/profiles/password_spec.rb +++ b/spec/features/profiles/password_spec.rb @@ -117,7 +117,7 @@ describe 'Profile > Password' do before do sign_in(user) - user.update_attributes(password_expires_at: 1.hour.ago) + user.update(password_expires_at: 1.hour.ago) user.identities.delete expect(user.ldap_user?).to eq false end diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 41f6c52fb8a..f56174fc85c 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -147,11 +147,8 @@ describe "User browses files" do page.within(".tree-table") do click_link("README.md") end - - # rubocop:disable Lint/Void # Test the full URLs of links instead of relative paths by `have_link(text: "...", href: "...")`. find("a", text: /^empty$/)["href"] == project_blob_url(project, "markdown/d/README.md") - # rubocop:enable Lint/Void end it "shows correct content of directory" do diff --git a/spec/features/projects/jobs/permissions_spec.rb b/spec/features/projects/jobs/permissions_spec.rb index e9588daf37d..e639f0cf82e 100644 --- a/spec/features/projects/jobs/permissions_spec.rb +++ b/spec/features/projects/jobs/permissions_spec.rb @@ -90,7 +90,7 @@ describe 'Project Jobs Permissions' do before do archive = fixture_file_upload('spec/fixtures/ci_build_artifacts.zip') - job.update_attributes(legacy_artifacts_file: archive) + job.update(legacy_artifacts_file: archive) end context 'when public access for jobs is disabled' do diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb index c742eb79392..35b1c46ecf6 100644 --- a/spec/features/projects/jobs_spec.rb +++ b/spec/features/projects/jobs_spec.rb @@ -187,7 +187,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do context "Download artifacts" do before do - job.update_attributes(legacy_artifacts_file: artifacts_file) + job.update(legacy_artifacts_file: artifacts_file) visit project_job_path(project, job) end @@ -198,8 +198,8 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do context 'Artifacts expire date' do before do - job.update_attributes(legacy_artifacts_file: artifacts_file, - artifacts_expire_at: expire_at) + job.update(legacy_artifacts_file: artifacts_file, + artifacts_expire_at: expire_at) visit project_job_path(project, job) end @@ -530,14 +530,14 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do describe "GET /:project/jobs/:id/download" do before do - job.update_attributes(legacy_artifacts_file: artifacts_file) + job.update(legacy_artifacts_file: artifacts_file) visit project_job_path(project, job) click_link 'Download' end context "Build from other project" do before do - job2.update_attributes(legacy_artifacts_file: artifacts_file) + job2.update(legacy_artifacts_file: artifacts_file) visit download_project_job_artifacts_path(project, job2) end diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb index 35d6ac1c650..5599cc9bf1b 100644 --- a/spec/features/projects/members/user_requests_access_spec.rb +++ b/spec/features/projects/members/user_requests_access_spec.rb @@ -11,7 +11,7 @@ describe 'Projects > Members > User requests access', :js do end it 'request access feature is disabled' do - project.update_attributes(request_access_enabled: false) + project.update(request_access_enabled: false) visit project_path(project) expect(page).not_to have_content 'Request Access' diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb index 9c165b17704..7d47e342e92 100644 --- a/spec/features/projects/pipelines/pipelines_spec.rb +++ b/spec/features/projects/pipelines/pipelines_spec.rb @@ -606,7 +606,7 @@ describe 'Pipelines', :js do describe 'user clicks the button' do context 'when project already has jobs_cache_index' do before do - project.update_attributes(jobs_cache_index: 1) + project.update(jobs_cache_index: 1) end it 'increments jobs_cache_index' do diff --git a/spec/features/projects/remote_mirror_spec.rb b/spec/features/projects/remote_mirror_spec.rb index 53a3f6f474b..97db4a2b8f2 100644 --- a/spec/features/projects/remote_mirror_spec.rb +++ b/spec/features/projects/remote_mirror_spec.rb @@ -13,7 +13,7 @@ describe 'Project remote mirror', :feature do context 'when last_error is present but last_update_at is not' do it 'renders error message without timstamp' do - remote_mirror.update_attributes(last_error: 'Some new error', last_update_at: nil) + remote_mirror.update(last_error: 'Some new error', last_update_at: nil) visit project_mirror_path(project) @@ -23,7 +23,7 @@ describe 'Project remote mirror', :feature do context 'when last_error and last_update_at are present' do it 'renders error message with timestamp' do - remote_mirror.update_attributes(last_error: 'Some new error', last_update_at: Time.now - 5.minutes) + remote_mirror.update(last_error: 'Some new error', last_update_at: Time.now - 5.minutes) visit project_mirror_path(project) diff --git a/spec/features/projects/services/user_activates_slack_notifications_spec.rb b/spec/features/projects/services/user_activates_slack_notifications_spec.rb index fae9ebd1bd6..727b1fe2d11 100644 --- a/spec/features/projects/services/user_activates_slack_notifications_spec.rb +++ b/spec/features/projects/services/user_activates_slack_notifications_spec.rb @@ -29,7 +29,7 @@ describe 'User activates Slack notifications' do context 'when service is already configured' do before do service.fields - service.update_attributes( + service.update( push_channel: 1, issue_channel: 2, merge_request_channel: 3, diff --git a/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb b/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb index aa23bef6fd8..d9d57298929 100644 --- a/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb +++ b/spec/features/projects/show/user_sees_deletion_failure_message_spec.rb @@ -8,7 +8,7 @@ describe 'Projects > Show > User sees a deletion failure message' do end it 'shows error message if deletion for project fails' do - project.update_attributes(delete_error: "Something went wrong", pending_delete: false) + project.update(delete_error: "Something went wrong", pending_delete: false) visit project_path(project) diff --git a/spec/features/signed_commits_spec.rb b/spec/features/signed_commits_spec.rb index db141ef7096..bc9443c6093 100644 --- a/spec/features/signed_commits_spec.rb +++ b/spec/features/signed_commits_spec.rb @@ -23,7 +23,7 @@ describe 'GPG signed commits', :js do # user changes his email which makes the gpg key verified Sidekiq::Testing.inline! do user.skip_reconfirmation! - user.update_attributes!(email: GpgHelpers::User1.emails.first) + user.update!(email: GpgHelpers::User1.emails.first) end visit project_commits_path(project, :'signed-commits') |