From 5069682d8ed892705ec1a933554cc4060e5691af Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Tue, 25 Apr 2017 13:28:55 +0100 Subject: Enable RSpec/FilePath cop - Ignore JS fixtures - Ignore qa directory - Rewrite concern specs to put concern name first --- spec/serializers/analytics_generic_entity_spec.rb | 39 ----------------------- spec/serializers/analytics_issue_entity_spec.rb | 39 +++++++++++++++++++++++ 2 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 spec/serializers/analytics_generic_entity_spec.rb create mode 100644 spec/serializers/analytics_issue_entity_spec.rb (limited to 'spec/serializers') diff --git a/spec/serializers/analytics_generic_entity_spec.rb b/spec/serializers/analytics_generic_entity_spec.rb deleted file mode 100644 index 68086216ba9..00000000000 --- a/spec/serializers/analytics_generic_entity_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -require 'spec_helper' - -describe AnalyticsIssueEntity do - let(:user) { create(:user) } - let(:entity_hash) do - { - total_time: "172802.724419", - title: "Eos voluptatem inventore in sed.", - iid: "1", - id: "1", - created_at: "2016-11-12 15:04:02.948604", - author: user, - } - end - - let(:project) { create(:empty_project) } - let(:request) { EntityRequest.new(project: project, entity: :merge_request) } - - let(:entity) do - described_class.new(entity_hash, request: request, project: project) - end - - context 'generic entity' do - subject { entity.as_json } - - it 'contains the entity URL' do - expect(subject).to include(:url) - end - - it 'contains the author' do - expect(subject).to include(:author) - end - - it 'does not contain sensitive information' do - expect(subject).not_to include(/token/) - expect(subject).not_to include(/variables/) - end - end -end diff --git a/spec/serializers/analytics_issue_entity_spec.rb b/spec/serializers/analytics_issue_entity_spec.rb new file mode 100644 index 00000000000..68086216ba9 --- /dev/null +++ b/spec/serializers/analytics_issue_entity_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper' + +describe AnalyticsIssueEntity do + let(:user) { create(:user) } + let(:entity_hash) do + { + total_time: "172802.724419", + title: "Eos voluptatem inventore in sed.", + iid: "1", + id: "1", + created_at: "2016-11-12 15:04:02.948604", + author: user, + } + end + + let(:project) { create(:empty_project) } + let(:request) { EntityRequest.new(project: project, entity: :merge_request) } + + let(:entity) do + described_class.new(entity_hash, request: request, project: project) + end + + context 'generic entity' do + subject { entity.as_json } + + it 'contains the entity URL' do + expect(subject).to include(:url) + end + + it 'contains the author' do + expect(subject).to include(:author) + end + + it 'does not contain sensitive information' do + expect(subject).not_to include(/token/) + expect(subject).not_to include(/variables/) + end + end +end -- cgit v1.2.1