diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-21 17:29:35 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:31:56 -0600 |
commit | 3dadf306ddc81183e74b048bc4119796852ed7ea (patch) | |
tree | f01d5e7eb9c5550bc34a42d9e88479cd3fef578d /spec/models | |
parent | 547063b3ac096dff25309b6e0846b0d5f417c128 (diff) | |
download | gitlab-ce-3dadf306ddc81183e74b048bc4119796852ed7ea.tar.gz |
Enable Style/DotPosition
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/application_setting_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/ci/build_spec.rb | 16 | ||||
-rw-r--r-- | spec/models/commit_status_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/email_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/group_label_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/lfs_objects_project_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/merge_request_diff_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 24 | ||||
-rw-r--r-- | spec/models/project_label_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 8 |
11 files changed, 49 insertions, 49 deletions
diff --git a/spec/models/application_setting_spec.rb b/spec/models/application_setting_spec.rb index b950fcdd81a..53011008f44 100644 --- a/spec/models/application_setting_spec.rb +++ b/spec/models/application_setting_spec.rb @@ -32,9 +32,9 @@ describe ApplicationSetting, models: true do it { is_expected.to validate_presence_of(:max_attachment_size) } it do - is_expected.to validate_numericality_of(:max_attachment_size) - .only_integer - .is_greater_than(0) + is_expected.to validate_numericality_of(:max_attachment_size). + only_integer. + is_greater_than(0) end it_behaves_like 'an object with email-formated attributes', :admin_notification_email do diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 2dfca8bcfce..2725c63f13b 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -212,15 +212,15 @@ describe Ci::Build, :models do retried_rspec = Ci::Build.retry(rspec_test, user) - expect(staging.depends_on_builds.map(&:id)) - .to contain_exactly(build.id, retried_rspec.id, rubocop_test.id) + expect(staging.depends_on_builds.map(&:id)). + to contain_exactly(build.id, retried_rspec.id, rubocop_test.id) end end describe '#detailed_status' do it 'returns a detailed status' do - expect(build.detailed_status(user)) - .to be_a Gitlab::Ci::Status::Build::Cancelable + expect(build.detailed_status(user)). + to be_a Gitlab::Ci::Status::Build::Cancelable end end @@ -1151,8 +1151,8 @@ describe Ci::Build, :models do let!(:build) { create(:ci_build, artifacts_size: 23) } it 'updates project statistics when the artifact size changes' do - expect(ProjectCacheWorker).to receive(:perform_async) - .with(build.project_id, [], [:build_artifacts_size]) + expect(ProjectCacheWorker).to receive(:perform_async). + with(build.project_id, [], [:build_artifacts_size]) build.artifacts_size = 42 build.save! @@ -1166,8 +1166,8 @@ describe Ci::Build, :models do end it 'updates project statistics when the build is destroyed' do - expect(ProjectCacheWorker).to receive(:perform_async) - .with(build.project_id, [], [:build_artifacts_size]) + expect(ProjectCacheWorker).to receive(:perform_async). + with(build.project_id, [], [:build_artifacts_size]) build.destroy end diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index 36533bdd11e..f770e6a9e34 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -253,8 +253,8 @@ describe CommitStatus, :models do let(:user) { create(:user) } it 'returns a detailed status' do - expect(commit_status.detailed_status(user)) - .to be_a Gitlab::Ci::Status::Success + expect(commit_status.detailed_status(user)). + to be_a Gitlab::Ci::Status::Success end end diff --git a/spec/models/email_spec.rb b/spec/models/email_spec.rb index fe4de1b2afb..4652af1cb97 100644 --- a/spec/models/email_spec.rb +++ b/spec/models/email_spec.rb @@ -8,7 +8,7 @@ describe Email, models: true do end it 'normalize email value' do - expect(described_class.new(email: ' inFO@exAMPLe.com ').email) - .to eq 'info@example.com' + expect(described_class.new(email: ' inFO@exAMPLe.com ').email). + to eq 'info@example.com' end end diff --git a/spec/models/group_label_spec.rb b/spec/models/group_label_spec.rb index 555a876daeb..c8d88022ec7 100644 --- a/spec/models/group_label_spec.rb +++ b/spec/models/group_label_spec.rb @@ -49,8 +49,8 @@ describe GroupLabel, models: true do context 'using invalid format' do it 'raises error' do - expect { label.to_reference(format: :invalid) } - .to raise_error StandardError, /Unknown format/ + expect { label.to_reference(format: :invalid) }. + to raise_error StandardError, /Unknown format/ end end end diff --git a/spec/models/lfs_objects_project_spec.rb b/spec/models/lfs_objects_project_spec.rb index 7bc278e350f..a2031beeab2 100644 --- a/spec/models/lfs_objects_project_spec.rb +++ b/spec/models/lfs_objects_project_spec.rb @@ -18,8 +18,8 @@ describe LfsObjectsProject, models: true do describe '#update_project_statistics' do it 'updates project statistics when the object is added' do - expect(ProjectCacheWorker).to receive(:perform_async) - .with(project.id, [], [:lfs_objects_size]) + expect(ProjectCacheWorker).to receive(:perform_async). + with(project.id, [], [:lfs_objects_size]) subject.save! end @@ -27,8 +27,8 @@ describe LfsObjectsProject, models: true do it 'updates project statistics when the object is removed' do subject.save! - expect(ProjectCacheWorker).to receive(:perform_async) - .with(project.id, [], [:lfs_objects_size]) + expect(ProjectCacheWorker).to receive(:perform_async). + with(project.id, [], [:lfs_objects_size]) subject.destroy end diff --git a/spec/models/merge_request_diff_spec.rb b/spec/models/merge_request_diff_spec.rb index 6d599e148a2..1b7360257e8 100644 --- a/spec/models/merge_request_diff_spec.rb +++ b/spec/models/merge_request_diff_spec.rb @@ -84,8 +84,8 @@ describe MergeRequestDiff, models: true do end it 'saves overflow state' do - allow(Commit).to receive(:max_diff_options) - .and_return(max_lines: 0, max_files: 0) + allow(Commit).to receive(:max_diff_options). + and_return(max_lines: 0, max_files: 0) mr_diff = create(:merge_request).merge_request_diff @@ -93,8 +93,8 @@ describe MergeRequestDiff, models: true do end it 'saves empty state' do - allow_any_instance_of(MergeRequestDiff).to receive(:commits) - .and_return([]) + allow_any_instance_of(MergeRequestDiff).to receive(:commits). + and_return([]) mr_diff = create(:merge_request).merge_request_diff diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index a01741a9971..810c08256dc 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -412,15 +412,15 @@ describe MergeRequest, models: true do it 'includes merge information as the title' do request = build(:merge_request, source_branch: 'source', target_branch: 'target') - expect(request.merge_commit_message) - .to match("Merge branch 'source' into 'target'\n\n") + expect(request.merge_commit_message). + to match("Merge branch 'source' into 'target'\n\n") end it 'includes its title in the body' do request = build(:merge_request, title: 'Remove all technical debt') - expect(request.merge_commit_message) - .to match("Remove all technical debt\n\n") + expect(request.merge_commit_message). + to match("Remove all technical debt\n\n") end it 'includes its closed issues in the body' do @@ -432,15 +432,15 @@ describe MergeRequest, models: true do allow(subject.project).to receive(:default_branch). and_return(subject.target_branch) - expect(subject.merge_commit_message) - .to match("Closes #{issue.to_reference}") + expect(subject.merge_commit_message). + to match("Closes #{issue.to_reference}") end it 'includes its reference in the body' do request = build_stubbed(:merge_request) - expect(request.merge_commit_message) - .to match("See merge request #{request.to_reference}") + expect(request.merge_commit_message). + to match("See merge request #{request.to_reference}") end it 'excludes multiple linebreak runs when description is blank' do @@ -452,15 +452,15 @@ describe MergeRequest, models: true do it 'includes its description in the body' do request = build(:merge_request, description: 'By removing all code') - expect(request.merge_commit_message(include_description: true)) - .to match("By removing all code\n\n") + expect(request.merge_commit_message(include_description: true)). + to match("By removing all code\n\n") end it 'does not includes its description in the body' do request = build(:merge_request, description: 'By removing all code') - expect(request.merge_commit_message) - .not_to match("By removing all code\n\n") + expect(request.merge_commit_message). + not_to match("By removing all code\n\n") end end diff --git a/spec/models/project_label_spec.rb b/spec/models/project_label_spec.rb index 9cdbfa44e5b..3e9dd3758ed 100644 --- a/spec/models/project_label_spec.rb +++ b/spec/models/project_label_spec.rb @@ -94,8 +94,8 @@ describe ProjectLabel, models: true do context 'using invalid format' do it 'raises error' do - expect { label.to_reference(format: :invalid) } - .to raise_error StandardError, /Unknown format/ + expect { label.to_reference(format: :invalid) }. + to raise_error StandardError, /Unknown format/ end end @@ -104,15 +104,15 @@ describe ProjectLabel, models: true do context 'using name' do it 'returns cross reference with label name' do - expect(label.to_reference(project, format: :name)) - .to eq %Q(#{label.project.path_with_namespace}~"#{label.name}") + expect(label.to_reference(project, format: :name)). + to eq %Q(#{label.project.path_with_namespace}~"#{label.name}") end end context 'using id' do it 'returns cross reference with label id' do - expect(label.to_reference(project, format: :id)) - .to eq %Q(#{label.project.path_with_namespace}~#{label.id}) + expect(label.to_reference(project, format: :id)). + to eq %Q(#{label.project.path_with_namespace}~#{label.id}) end end end diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 838fd3754b2..0d1db97cd5b 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -265,8 +265,8 @@ describe Repository, models: true do describe '#commit' do context 'when ref exists' do it 'returns commit object' do - expect(repository.commit('master')) - .to be_an_instance_of Commit + expect(repository.commit('master')). + to be_an_instance_of Commit end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 584a4facd94..42029b15f4e 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1148,8 +1148,8 @@ describe User, models: true do user = create(:user) project = create(:empty_project, :private, namespace: user.namespace) - expect(user.authorized_projects(Gitlab::Access::REPORTER)) - .to contain_exactly(project) + expect(user.authorized_projects(Gitlab::Access::REPORTER)). + to contain_exactly(project) end it 'includes projects for which the user is a master' do @@ -1158,8 +1158,8 @@ describe User, models: true do project.team << [user, Gitlab::Access::MASTER] - expect(user.authorized_projects(Gitlab::Access::REPORTER)) - .to contain_exactly(project) + expect(user.authorized_projects(Gitlab::Access::REPORTER)). + to contain_exactly(project) end end |