diff options
Diffstat (limited to 'spec/serializers/analytics_build_entity_spec.rb')
-rw-r--r-- | spec/serializers/analytics_build_entity_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/serializers/analytics_build_entity_spec.rb b/spec/serializers/analytics_build_entity_spec.rb new file mode 100644 index 00000000000..9ac6f20fd3c --- /dev/null +++ b/spec/serializers/analytics_build_entity_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +describe AnalyticsBuildEntity do + let(:entity) do + described_class.new(build, request: double) + end + + context 'build with an author' do + let(:user) { create(:user) } + let(:build) { create(:ci_build, author: user) } + + subject { entity.as_json } + + it 'contains the 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 |