diff options
author | Keifer Furzland <kfrz.code@gmail.com> | 2017-06-28 23:13:10 -0500 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-07-27 14:31:52 +0200 |
commit | 7e113b6824628a7e82e93965300f2ce3b9aadf4b (patch) | |
tree | 59e693d816211d7ee10df95213e2f28a434f9dc5 /spec/models | |
parent | 4eebd8e1957a3fc3a3479331fde9f34aa8afa9d5 (diff) | |
download | gitlab-ce-7e113b6824628a7e82e93965300f2ce3b9aadf4b.tar.gz |
Remove superfluous type defs in specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models')
42 files changed, 49 insertions, 49 deletions
diff --git a/spec/models/abuse_report_spec.rb b/spec/models/abuse_report_spec.rb index c1bf5551fe0..d4da30b1641 100644 --- a/spec/models/abuse_report_spec.rb +++ b/spec/models/abuse_report_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe AbuseReport, type: :model do +RSpec.describe AbuseReport do subject { create(:abuse_report) } let(:user) { create(:admin) } diff --git a/spec/models/appearance_spec.rb b/spec/models/appearance_spec.rb index 1060bf3cbf4..7cd3a84d592 100644 --- a/spec/models/appearance_spec.rb +++ b/spec/models/appearance_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Appearance, type: :model do +RSpec.describe Appearance do subject { build(:appearance) } it { is_expected.to be_valid } diff --git a/spec/models/blob_viewer/base_spec.rb b/spec/models/blob_viewer/base_spec.rb index 574438838d8..e3640097dff 100644 --- a/spec/models/blob_viewer/base_spec.rb +++ b/spec/models/blob_viewer/base_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::Base, model: true do +describe BlobViewer::Base do include FakeBlobHelpers let(:project) { build(:empty_project) } diff --git a/spec/models/blob_viewer/changelog_spec.rb b/spec/models/blob_viewer/changelog_spec.rb index 9066c5a05ac..db41eca0fc8 100644 --- a/spec/models/blob_viewer/changelog_spec.rb +++ b/spec/models/blob_viewer/changelog_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::Changelog, model: true do +describe BlobViewer::Changelog do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/blob_viewer/composer_json_spec.rb b/spec/models/blob_viewer/composer_json_spec.rb index df4f1f4815c..82f6f7e5046 100644 --- a/spec/models/blob_viewer/composer_json_spec.rb +++ b/spec/models/blob_viewer/composer_json_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::ComposerJson, model: true do +describe BlobViewer::ComposerJson do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/gemspec_spec.rb b/spec/models/blob_viewer/gemspec_spec.rb index 81e932de290..14cc5f3c0fd 100644 --- a/spec/models/blob_viewer/gemspec_spec.rb +++ b/spec/models/blob_viewer/gemspec_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::Gemspec, model: true do +describe BlobViewer::Gemspec do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb index 0c6c24ece21..7a4f9866375 100644 --- a/spec/models/blob_viewer/gitlab_ci_yml_spec.rb +++ b/spec/models/blob_viewer/gitlab_ci_yml_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::GitlabCiYml, model: true do +describe BlobViewer::GitlabCiYml do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/license_spec.rb b/spec/models/blob_viewer/license_spec.rb index 944ddd32b92..222ed166ee0 100644 --- a/spec/models/blob_viewer/license_spec.rb +++ b/spec/models/blob_viewer/license_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::License, model: true do +describe BlobViewer::License do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/blob_viewer/package_json_spec.rb b/spec/models/blob_viewer/package_json_spec.rb index 5c9a9c81963..96fb1b08c99 100644 --- a/spec/models/blob_viewer/package_json_spec.rb +++ b/spec/models/blob_viewer/package_json_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::PackageJson, model: true do +describe BlobViewer::PackageJson do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/podspec_json_spec.rb b/spec/models/blob_viewer/podspec_json_spec.rb index 42a00940bc5..f510077a87b 100644 --- a/spec/models/blob_viewer/podspec_json_spec.rb +++ b/spec/models/blob_viewer/podspec_json_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::PodspecJson, model: true do +describe BlobViewer::PodspecJson do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/podspec_spec.rb b/spec/models/blob_viewer/podspec_spec.rb index 6c9f0f42d53..7c38083550c 100644 --- a/spec/models/blob_viewer/podspec_spec.rb +++ b/spec/models/blob_viewer/podspec_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::Podspec, model: true do +describe BlobViewer::Podspec do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/readme_spec.rb b/spec/models/blob_viewer/readme_spec.rb index 02679dbb544..926df21ffda 100644 --- a/spec/models/blob_viewer/readme_spec.rb +++ b/spec/models/blob_viewer/readme_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::Readme, model: true do +describe BlobViewer::Readme do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/blob_viewer/route_map_spec.rb b/spec/models/blob_viewer/route_map_spec.rb index 4854e0262d9..115731b4970 100644 --- a/spec/models/blob_viewer/route_map_spec.rb +++ b/spec/models/blob_viewer/route_map_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::RouteMap, model: true do +describe BlobViewer::RouteMap do include FakeBlobHelpers let(:project) { build(:project) } diff --git a/spec/models/blob_viewer/server_side_spec.rb b/spec/models/blob_viewer/server_side_spec.rb index f047953d540..2639eec9e84 100644 --- a/spec/models/blob_viewer/server_side_spec.rb +++ b/spec/models/blob_viewer/server_side_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe BlobViewer::ServerSide, model: true do +describe BlobViewer::ServerSide do include FakeBlobHelpers let(:project) { build(:empty_project) } diff --git a/spec/models/chat_team_spec.rb b/spec/models/chat_team_spec.rb index 5283561a83f..e0e5f73e6fe 100644 --- a/spec/models/chat_team_spec.rb +++ b/spec/models/chat_team_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe ChatTeam, type: :model do +describe ChatTeam do subject { create(:chat_team) } # Associations diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 0b521d720f3..a18da3768d5 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Ci::Build, :models do +describe Ci::Build do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:build) { create(:ci_build, pipeline: pipeline) } @@ -225,7 +225,7 @@ describe Ci::Build, :models do it 'expects to have retried builds instead the original ones' do project.add_developer(user) - retried_rspec = Ci::Build.retry(rspec_test, user) + retried_rspec = described_class.retry(rspec_test, user) expect(staging.depends_on_builds.map(&:id)) .to contain_exactly(build.id, retried_rspec.id, rubocop_test.id) @@ -620,9 +620,9 @@ describe Ci::Build, :models do describe '#first_pending' do let!(:first) { create(:ci_build, pipeline: pipeline, status: 'pending', created_at: Date.yesterday) } let!(:second) { create(:ci_build, pipeline: pipeline, status: 'pending') } - subject { Ci::Build.first_pending } + subject { described_class.first_pending } - it { is_expected.to be_a(Ci::Build) } + it { is_expected.to be_a(described_class) } it('returns with the first pending build') { is_expected.to eq(first) } end @@ -945,7 +945,7 @@ describe Ci::Build, :models do end context 'when build is retried' do - let!(:new_build) { Ci::Build.retry(build, user) } + let!(:new_build) { described_class.retry(build, user) } it 'does not return any of them' do is_expected.not_to include(build, new_build) @@ -953,7 +953,7 @@ describe Ci::Build, :models do end context 'when other build is retried' do - let!(:retried_build) { Ci::Build.retry(other_build, user) } + let!(:retried_build) { described_class.retry(other_build, user) } before do retried_build.success diff --git a/spec/models/ci/legacy_stage_spec.rb b/spec/models/ci/legacy_stage_spec.rb index d43c33d3807..0c33c1466b7 100644 --- a/spec/models/ci/legacy_stage_spec.rb +++ b/spec/models/ci/legacy_stage_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Ci::LegacyStage, :models do +describe Ci::LegacyStage do let(:stage) { build(:ci_stage) } let(:pipeline) { stage.pipeline } let(:stage_name) { stage.name } diff --git a/spec/models/commit_status_spec.rb b/spec/models/commit_status_spec.rb index 1e074c7ad26..6fb4794ea5f 100644 --- a/spec/models/commit_status_spec.rb +++ b/spec/models/commit_status_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe CommitStatus, :models do +describe CommitStatus do let(:project) { create(:project, :repository) } let(:pipeline) do diff --git a/spec/models/concerns/discussion_on_diff_spec.rb b/spec/models/concerns/discussion_on_diff_spec.rb index f3e148f95f0..2322eb206fb 100644 --- a/spec/models/concerns/discussion_on_diff_spec.rb +++ b/spec/models/concerns/discussion_on_diff_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe DiscussionOnDiff, model: true do +describe DiscussionOnDiff do subject { create(:diff_note_on_merge_request).to_discussion } describe "#truncated_diff_lines" do diff --git a/spec/models/concerns/noteable_spec.rb b/spec/models/concerns/noteable_spec.rb index bdae742ff1d..485a6e165a1 100644 --- a/spec/models/concerns/noteable_spec.rb +++ b/spec/models/concerns/noteable_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Noteable, model: true do +describe Noteable do let!(:active_diff_note1) { create(:diff_note_on_merge_request) } let(:project) { active_diff_note1.project } subject { active_diff_note1.noteable } diff --git a/spec/models/cycle_analytics/code_spec.rb b/spec/models/cycle_analytics/code_spec.rb index 9053485939e..f2f1928926c 100644 --- a/spec/models/cycle_analytics/code_spec.rb +++ b/spec/models/cycle_analytics/code_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CycleAnalytics#code', feature: true do +describe 'CycleAnalytics#code' do extend CycleAnalyticsHelpers::TestGeneration let(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/plan_spec.rb b/spec/models/cycle_analytics/plan_spec.rb index 4f33f3c6d69..6fbb2a2d102 100644 --- a/spec/models/cycle_analytics/plan_spec.rb +++ b/spec/models/cycle_analytics/plan_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CycleAnalytics#plan', feature: true do +describe 'CycleAnalytics#plan' do extend CycleAnalyticsHelpers::TestGeneration let(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/production_spec.rb b/spec/models/cycle_analytics/production_spec.rb index 4744b9e05ea..f8681c0a2f9 100644 --- a/spec/models/cycle_analytics/production_spec.rb +++ b/spec/models/cycle_analytics/production_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CycleAnalytics#production', feature: true do +describe 'CycleAnalytics#production' do extend CycleAnalyticsHelpers::TestGeneration let(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/review_spec.rb b/spec/models/cycle_analytics/review_spec.rb index febb18c9884..0ac58695b35 100644 --- a/spec/models/cycle_analytics/review_spec.rb +++ b/spec/models/cycle_analytics/review_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CycleAnalytics#review', feature: true do +describe 'CycleAnalytics#review' do extend CycleAnalyticsHelpers::TestGeneration let(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/staging_spec.rb b/spec/models/cycle_analytics/staging_spec.rb index f78d7a23105..b66d5623910 100644 --- a/spec/models/cycle_analytics/staging_spec.rb +++ b/spec/models/cycle_analytics/staging_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CycleAnalytics#staging', feature: true do +describe 'CycleAnalytics#staging' do extend CycleAnalyticsHelpers::TestGeneration let(:project) { create(:project, :repository) } diff --git a/spec/models/cycle_analytics/test_spec.rb b/spec/models/cycle_analytics/test_spec.rb index fd58bd1d6ad..690c09bc2dc 100644 --- a/spec/models/cycle_analytics/test_spec.rb +++ b/spec/models/cycle_analytics/test_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'CycleAnalytics#test', feature: true do +describe 'CycleAnalytics#test' do extend CycleAnalyticsHelpers::TestGeneration let(:project) { create(:project, :repository) } diff --git a/spec/models/diff_discussion_spec.rb b/spec/models/diff_discussion_spec.rb index 45b2f6e4beb..2704698f6c9 100644 --- a/spec/models/diff_discussion_spec.rb +++ b/spec/models/diff_discussion_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe DiffDiscussion, model: true do +describe DiffDiscussion do include RepoHelpers subject { described_class.new([diff_note]) } diff --git a/spec/models/diff_viewer/base_spec.rb b/spec/models/diff_viewer/base_spec.rb index 3755f4a56f3..b26de3f3b97 100644 --- a/spec/models/diff_viewer/base_spec.rb +++ b/spec/models/diff_viewer/base_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe DiffViewer::Base, model: true do +describe DiffViewer::Base do include FakeBlobHelpers let(:project) { create(:project, :repository) } diff --git a/spec/models/diff_viewer/server_side_spec.rb b/spec/models/diff_viewer/server_side_spec.rb index 2d926e06936..92e613f92de 100644 --- a/spec/models/diff_viewer/server_side_spec.rb +++ b/spec/models/diff_viewer/server_side_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe DiffViewer::ServerSide, model: true do +describe DiffViewer::ServerSide do let(:project) { create(:project, :repository) } let(:commit) { project.commit('570e7b2abdd848b95f2f578043fc23bd6f6fd24d') } let(:diff_file) { commit.diffs.diff_file_with_new_path('files/ruby/popen.rb') } diff --git a/spec/models/discussion_spec.rb b/spec/models/discussion_spec.rb index 0221e23ced8..a46f7ed6507 100644 --- a/spec/models/discussion_spec.rb +++ b/spec/models/discussion_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Discussion, model: true do +describe Discussion do subject { described_class.new([first_note, second_note, third_note]) } let(:first_note) { create(:diff_note_on_merge_request) } diff --git a/spec/models/merge_request_diff_commit_spec.rb b/spec/models/merge_request_diff_commit_spec.rb index dbfd1526518..9d4a0ecf8c0 100644 --- a/spec/models/merge_request_diff_commit_spec.rb +++ b/spec/models/merge_request_diff_commit_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe MergeRequestDiffCommit, type: :model do +describe MergeRequestDiffCommit do let(:merge_request) { create(:merge_request) } subject { merge_request.commits.first } diff --git a/spec/models/merge_request_diff_file_spec.rb b/spec/models/merge_request_diff_file_spec.rb index 239620ef4fc..faa47660a74 100644 --- a/spec/models/merge_request_diff_file_spec.rb +++ b/spec/models/merge_request_diff_file_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe MergeRequestDiffFile, type: :model do +describe MergeRequestDiffFile do describe '#diff' do let(:unpacked) { 'unpacked' } let(:packed) { [unpacked].pack('m0') } diff --git a/spec/models/notification_setting_spec.rb b/spec/models/notification_setting_spec.rb index 76a7b07949f..07e296424ca 100644 --- a/spec/models/notification_setting_spec.rb +++ b/spec/models/notification_setting_spec.rb @@ -1,13 +1,13 @@ require 'rails_helper' -RSpec.describe NotificationSetting, type: :model do +RSpec.describe NotificationSetting do describe "Associations" do it { is_expected.to belong_to(:user) } it { is_expected.to belong_to(:source) } end describe "Validation" do - subject { NotificationSetting.new(source_id: 1, source_type: 'Project') } + subject { described_class.new(source_id: 1, source_type: 'Project') } it { is_expected.to validate_presence_of(:user) } it { is_expected.to validate_presence_of(:level) } @@ -22,7 +22,7 @@ RSpec.describe NotificationSetting, type: :model do context "events" do let(:user) { create(:user) } - let(:notification_setting) { NotificationSetting.new(source_id: 1, source_type: 'Project', user_id: user.id) } + let(:notification_setting) { described_class.new(source_id: 1, source_type: 'Project', user_id: user.id) } before do notification_setting.level = "custom" diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb index fa38d23e82f..4c21c8b88bd 100644 --- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb +++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe MattermostSlashCommandsService, :models do +describe MattermostSlashCommandsService do it_behaves_like "chat slash commands service" context 'Mattermost API' do diff --git a/spec/models/project_services/slack_slash_commands_service_spec.rb b/spec/models/project_services/slack_slash_commands_service_spec.rb index 5766aa340e2..aea674c4f6b 100644 --- a/spec/models/project_services/slack_slash_commands_service_spec.rb +++ b/spec/models/project_services/slack_slash_commands_service_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe SlackSlashCommandsService, :models do +describe SlackSlashCommandsService do it_behaves_like "chat slash commands service" describe '#trigger' do diff --git a/spec/models/protected_branch/merge_access_level_spec.rb b/spec/models/protected_branch/merge_access_level_spec.rb index 1e7242e9fa8..f70503eadbc 100644 --- a/spec/models/protected_branch/merge_access_level_spec.rb +++ b/spec/models/protected_branch/merge_access_level_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe ProtectedBranch::MergeAccessLevel, :models do +describe ProtectedBranch::MergeAccessLevel do it { is_expected.to validate_inclusion_of(:access_level).in_array([Gitlab::Access::MASTER, Gitlab::Access::DEVELOPER, Gitlab::Access::NO_ACCESS]) } end diff --git a/spec/models/protected_branch/push_access_level_spec.rb b/spec/models/protected_branch/push_access_level_spec.rb index de68351198c..f161f345761 100644 --- a/spec/models/protected_branch/push_access_level_spec.rb +++ b/spec/models/protected_branch/push_access_level_spec.rb @@ -1,5 +1,5 @@ require 'spec_helper' -describe ProtectedBranch::PushAccessLevel, :models do +describe ProtectedBranch::PushAccessLevel do it { is_expected.to validate_inclusion_of(:access_level).in_array([Gitlab::Access::MASTER, Gitlab::Access::DEVELOPER, Gitlab::Access::NO_ACCESS]) } end diff --git a/spec/models/release_spec.rb b/spec/models/release_spec.rb index 527005b2b69..3f86347c3ae 100644 --- a/spec/models/release_spec.rb +++ b/spec/models/release_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Release, type: :model do +RSpec.describe Release do let(:release) { create(:release) } it { expect(release).to be_valid } diff --git a/spec/models/sent_notification_spec.rb b/spec/models/sent_notification_spec.rb index 5710edbc9e0..823cdb853eb 100644 --- a/spec/models/sent_notification_spec.rb +++ b/spec/models/sent_notification_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe SentNotification, model: true do +describe SentNotification do describe 'validation' do describe 'note validity' do context "when the project doesn't match the noteable's project" do diff --git a/spec/models/timelog_spec.rb b/spec/models/timelog_spec.rb index ebc694213b6..6e30798356c 100644 --- a/spec/models/timelog_spec.rb +++ b/spec/models/timelog_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -RSpec.describe Timelog, type: :model do +RSpec.describe Timelog do subject { build(:timelog) } let(:issue) { create(:issue) } let(:merge_request) { create(:merge_request) } diff --git a/spec/models/upload_spec.rb b/spec/models/upload_spec.rb index 2dea2c6015f..345382ea8c7 100644 --- a/spec/models/upload_spec.rb +++ b/spec/models/upload_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe Upload, type: :model do +describe Upload do describe 'assocations' do it { is_expected.to belong_to(:model) } end diff --git a/spec/models/user_agent_detail_spec.rb b/spec/models/user_agent_detail_spec.rb index a8c25766e73..b4669f8c1c2 100644 --- a/spec/models/user_agent_detail_spec.rb +++ b/spec/models/user_agent_detail_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe UserAgentDetail, type: :model do +describe UserAgentDetail do describe '.submittable?' do it 'is submittable when not already submitted' do detail = build(:user_agent_detail) |