diff options
author | James Lopez <james@jameslopez.es> | 2016-11-18 14:05:29 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-18 14:05:29 +0300 |
commit | cb353d655bd8802c14a1e12e0fe78a1f7cc2e4ed (patch) | |
tree | 957a43197d95eaf81af9f570c30e44a2169e6179 /spec/lib | |
parent | c76ef847817ac6346b2f367be63f482ee2df382a (diff) |
added new build updater, specs and refactored allowed_ids
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/cycle_analytics/author_updater_spec.rb | 12 | ||||
-rw-r--r-- | spec/lib/gitlab/cycle_analytics/build_updater_spec.rb | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/author_updater_spec.rb b/spec/lib/gitlab/cycle_analytics/author_updater_spec.rb new file mode 100644 index 00000000000..f9e4d1714e6 --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/author_updater_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe Gitlab::CycleAnalytics::AuthorUpdater do + let(:user) { create(:user) } + let(:events) { [{ 'author_id' => user.id }] } + + it 'maps the correct user' do + described_class.update!(events) + + expect(events.first['author']).to eq(user) + end +end diff --git a/spec/lib/gitlab/cycle_analytics/build_updater_spec.rb b/spec/lib/gitlab/cycle_analytics/build_updater_spec.rb new file mode 100644 index 00000000000..8e461f6c6ea --- /dev/null +++ b/spec/lib/gitlab/cycle_analytics/build_updater_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe Gitlab::CycleAnalytics::BuildUpdater do + let(:build) { create(:ci_build) } + let(:events) { [{ 'id' => build.id }] } + + it 'maps the correct user' do + described_class.update!(events) + + expect(events.first['build']).to eq(build) + end +end |