diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-11-18 16:50:50 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-11-18 16:50:50 +0300 |
commit | 2343b83098d91434748fba48b3b5de147bd805ef (patch) | |
tree | de250a7f15eeac636a7a42493e77d1aa1bf38504 /spec/serializers/analytics_build_serializer_spec.rb | |
parent | 058287ea0ff97ac6d2394f5446718b7a73efc3a9 (diff) | |
parent | f5b792e22eb7bd4ecafcd2ad3bc7a388abb36ffc (diff) |
Merge branch 'feature/cycle-analytics-events' into 'master'
Cycle Analytics: Events per stage
Adds list of events to each stage:
- Issue: list of issues created in the last XX days, that have been labeled or added to a milestone.
- Plan: list of commits that reference for the fist time an issue from the last stage.
- Code: list of MR created in this stage
- Test: List of unique builds triggered by the commits.
- Review: List of MR merged
- Staging: List of deployed builds
- Production: list of issues with the time from idea to production
Fixes #23449
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !6859
Diffstat (limited to 'spec/serializers/analytics_build_serializer_spec.rb')
-rw-r--r-- | spec/serializers/analytics_build_serializer_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/serializers/analytics_build_serializer_spec.rb b/spec/serializers/analytics_build_serializer_spec.rb new file mode 100644 index 00000000000..a0a9d9a5f12 --- /dev/null +++ b/spec/serializers/analytics_build_serializer_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe AnalyticsBuildSerializer do + let(:serializer) do + described_class + .new.represent(resource) + end + + let(:json) { serializer.as_json } + let(:resource) { create(:ci_build) } + + context 'when there is a single object provided' do + it 'it generates payload for single object' do + expect(json).to be_an_instance_of Hash + end + + it 'contains important elements of analyticsBuild' do + expect(json) + .to include(:name, :branch, :short_sha, :date, :total_time, :url, :author) + end + end +end |