summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/cycle_analytics/events_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/cycle_analytics/events_spec.rb')
-rw-r--r--spec/lib/gitlab/cycle_analytics/events_spec.rb118
1 files changed, 59 insertions, 59 deletions
diff --git a/spec/lib/gitlab/cycle_analytics/events_spec.rb b/spec/lib/gitlab/cycle_analytics/events_spec.rb
index 0fb6a62f10d..ebeea2be39e 100644
--- a/spec/lib/gitlab/cycle_analytics/events_spec.rb
+++ b/spec/lib/gitlab/cycle_analytics/events_spec.rb
@@ -14,61 +14,61 @@ describe Gitlab::CycleAnalytics::Events do
describe '#issue_events' do
it 'has the total time' do
- expect(subject.issue_events.first['total_time']).to eq('2 days')
+ expect(subject.issue_events.first[:total_time]).to eq('2 days')
end
it 'has a title' do
- expect(subject.issue_events.first['title']).to eq(context.title)
+ expect(subject.issue_events.first[:title]).to eq(context.title)
end
it 'has the URL' do
- expect(subject.issue_events.first['url']).not_to be_nil
+ expect(subject.issue_events.first[:url]).not_to be_nil
end
it 'has an iid' do
- expect(subject.issue_events.first['iid']).to eq(context.iid.to_s)
+ expect(subject.issue_events.first[:iid]).to eq(context.iid.to_s)
end
it 'has a created_at timestamp' do
- expect(subject.issue_events.first['created_at']).to end_with('ago')
+ expect(subject.issue_events.first[:created_at]).to end_with('ago')
end
it "has the author's URL" do
- expect(subject.issue_events.first['author_profile_url']).not_to be_nil
+ expect(subject.issue_events.first[:author_profile_url]).not_to be_nil
end
it "has the author's avatar URL" do
- expect(subject.issue_events.first['author_avatar_url']).not_to be_nil
+ expect(subject.issue_events.first[:author_avatar_url]).not_to be_nil
end
it "has the author's name" do
- expect(subject.issue_events.first['author_name']).to eq(context.author.name)
+ expect(subject.issue_events.first[:author_name]).to eq(context.author.name)
end
end
describe '#plan_events' do
it 'has a title' do
- expect(subject.plan_events.first['title']).not_to be_nil
+ expect(subject.plan_events.first[:title]).not_to be_nil
end
it 'has a sha short ID' do
- expect(subject.plan_events.first['sha']).not_to be_nil
+ expect(subject.plan_events.first[:sha]).not_to be_nil
end
it 'has the total time' do
- expect(subject.plan_events.first['total_time']).to eq('less than a minute')
+ expect(subject.plan_events.first[:total_time]).to eq('less than a minute')
end
it "has the author's URL" do
- expect(subject.plan_events.first['author_profile_url']).not_to be_nil
+ expect(subject.plan_events.first[:author_profile_url]).not_to be_nil
end
it "has the author's avatar URL" do
- expect(subject.plan_events.first['author_avatar_url']).not_to be_nil
+ expect(subject.plan_events.first[:author_avatar_url]).not_to be_nil
end
it "has the author's name" do
- expect(subject.plan_events.first['author_name']).not_to be_nil
+ expect(subject.plan_events.first[:author_name]).not_to be_nil
end
end
@@ -78,31 +78,31 @@ describe Gitlab::CycleAnalytics::Events do
end
it 'has the total time' do
- expect(subject.code_events.first['total_time']).to eq('less than a minute')
+ expect(subject.code_events.first[:total_time]).to eq('less than a minute')
end
it 'has a title' do
- expect(subject.code_events.first['title']).to eq('Awesome merge_request')
+ expect(subject.code_events.first[:title]).to eq('Awesome merge_request')
end
it 'has an iid' do
- expect(subject.code_events.first['iid']).to eq(context.iid.to_s)
+ expect(subject.code_events.first[:iid]).to eq(context.iid.to_s)
end
it 'has a created_at timestamp' do
- expect(subject.code_events.first['created_at']).to end_with('ago')
+ expect(subject.code_events.first[:created_at]).to end_with('ago')
end
it "has the author's URL" do
- expect(subject.code_events.first['author_profile_url']).not_to be_nil
+ expect(subject.code_events.first[:author_profile_url]).not_to be_nil
end
it "has the author's avatar URL" do
- expect(subject.code_events.first['author_avatar_url']).not_to be_nil
+ expect(subject.code_events.first[:author_avatar_url]).not_to be_nil
end
it "has the author's name" do
- expect(subject.code_events.first['author_name']).to eq(context.author.name)
+ expect(subject.code_events.first[:author_name]).to eq(context.author.name)
end
end
@@ -116,47 +116,47 @@ describe Gitlab::CycleAnalytics::Events do
end
before do
- create(:ci_build, pipeline: pipeline, status: :success)
- create(:ci_build, pipeline: pipeline, status: :success)
+ create(:ci_build, pipeline: pipeline, status: :success, author: user)
+ create(:ci_build, pipeline: pipeline, status: :success, author: user)
pipeline.run!
pipeline.succeed!
end
it 'has the name' do
- expect(subject.test_events.first['name']).not_to be_nil
+ expect(subject.test_events.first[:name]).not_to be_nil
end
it 'has the ID' do
- expect(subject.test_events.first['id']).not_to be_nil
+ expect(subject.test_events.first[:id]).not_to be_nil
end
it 'has the URL' do
- expect(subject.test_events.first['url']).not_to be_nil
+ expect(subject.test_events.first[:url]).not_to be_nil
end
it 'has the branch name' do
- expect(subject.test_events.first['branch']).not_to be_nil
+ expect(subject.test_events.first[:branch]).not_to be_nil
end
it 'has the branch URL' do
- expect(subject.test_events.first['branch_url']).not_to be_nil
+ expect(subject.test_events.first[:branch][:url]).not_to be_nil
end
it 'has the short SHA' do
- expect(subject.test_events.first['sha']).not_to be_nil
+ expect(subject.test_events.first[:short_sha]).not_to be_nil
end
it 'has the commit URL' do
- expect(subject.test_events.first['commit_url']).not_to be_nil
+ expect(subject.test_events.first[:commit_url]).not_to be_nil
end
it 'has the date' do
- expect(subject.test_events.first['date']).not_to be_nil
+ expect(subject.test_events.first[:date]).not_to be_nil
end
it 'has the total time' do
- expect(subject.test_events.first['total_time']).not_to be_nil
+ expect(subject.test_events.first[:total_time]).not_to be_nil
end
end
@@ -164,39 +164,39 @@ describe Gitlab::CycleAnalytics::Events do
let!(:context) { create(:issue, project: project, created_at: 2.days.ago) }
it 'has the total time' do
- expect(subject.review_events.first['total_time']).to eq('less than a minute')
+ expect(subject.review_events.first[:total_time]).to eq('less than a minute')
end
it 'has a title' do
- expect(subject.review_events.first['title']).to eq('Awesome merge_request')
+ expect(subject.review_events.first[:title]).to eq('Awesome merge_request')
end
it 'has an iid' do
- expect(subject.review_events.first['iid']).to eq(context.iid.to_s)
+ expect(subject.review_events.first[:iid]).to eq(context.iid.to_s)
end
it 'has the URL' do
- expect(subject.review_events.first['url']).not_to be_nil
+ expect(subject.review_events.first[:url]).not_to be_nil
end
it 'has a state' do
- expect(subject.review_events.first['state']).not_to be_nil
+ expect(subject.review_events.first[:state]).not_to be_nil
end
it 'has a created_at timestamp' do
- expect(subject.review_events.first['opened_at']).not_to be_nil
+ expect(subject.review_events.first[:opened_at]).not_to be_nil
end
it "has the author's URL" do
- expect(subject.review_events.first['author_profile_url']).not_to be_nil
+ expect(subject.review_events.first[:author_profile_url]).not_to be_nil
end
it "has the author's avatar URL" do
- expect(subject.review_events.first['author_avatar_url']).not_to be_nil
+ expect(subject.review_events.first[:author_avatar_url]).not_to be_nil
end
it "has the author's name" do
- expect(subject.review_events.first['author_name']).to eq(MergeRequest.first.author.name)
+ expect(subject.review_events.first[:author_name]).to eq(MergeRequest.first.author.name)
end
end
@@ -221,43 +221,43 @@ describe Gitlab::CycleAnalytics::Events do
end
it 'has the name' do
- expect(subject.staging_events.first['name']).not_to be_nil
+ expect(subject.staging_events.first[:name]).not_to be_nil
end
it 'has the ID' do
- expect(subject.staging_events.first['id']).not_to be_nil
+ expect(subject.staging_events.first[:id]).not_to be_nil
end
it 'has the URL' do
- expect(subject.staging_events.first['url']).not_to be_nil
+ expect(subject.staging_events.first[:url]).not_to be_nil
end
it 'has the branch name' do
- expect(subject.staging_events.first['branch']).not_to be_nil
+ expect(subject.staging_events.first[:branch]).not_to be_nil
end
it 'has the branch URL' do
- expect(subject.staging_events.first['branch_url']).not_to be_nil
+ expect(subject.staging_events.first[:branch_url]).not_to be_nil
end
it 'has the short SHA' do
- expect(subject.staging_events.first['sha']).not_to be_nil
+ expect(subject.staging_events.first[:sha]).not_to be_nil
end
it 'has the commit URL' do
- expect(subject.staging_events.first['commit_url']).not_to be_nil
+ expect(subject.staging_events.first[:commit_url]).not_to be_nil
end
it 'has the date' do
- expect(subject.staging_events.first['date']).not_to be_nil
+ expect(subject.staging_events.first[:date]).not_to be_nil
end
it 'has the total time' do
- expect(subject.staging_events.first['total_time']).not_to be_nil
+ expect(subject.staging_events.first[:total_time]).not_to be_nil
end
it 'has the author name' do
- expect(subject.staging_events.first['author_name']).not_to be_nil
+ expect(subject.staging_events.first[:author_name]).not_to be_nil
end
end
@@ -270,35 +270,35 @@ describe Gitlab::CycleAnalytics::Events do
end
it 'has the total time' do
- expect(subject.production_events.first['total_time']).to eq('2 days')
+ expect(subject.production_events.first[:total_time]).to eq('2 days')
end
it 'has a title' do
- expect(subject.production_events.first['title']).to eq(context.title)
+ expect(subject.production_events.first[:title]).to eq(context.title)
end
it 'has the URL' do
- expect(subject.production_events.first['url']).not_to be_nil
+ expect(subject.production_events.first[:url]).not_to be_nil
end
it 'has an iid' do
- expect(subject.production_events.first['iid']).to eq(context.iid.to_s)
+ expect(subject.production_events.first[:iid]).to eq(context.iid.to_s)
end
it 'has a created_at timestamp' do
- expect(subject.production_events.first['created_at']).to end_with('ago')
+ expect(subject.production_events.first[:created_at]).to end_with('ago')
end
it "has the author's URL" do
- expect(subject.production_events.first['author_profile_url']).not_to be_nil
+ expect(subject.production_events.first[:author_profile_url]).not_to be_nil
end
it "has the author's avatar URL" do
- expect(subject.production_events.first['author_avatar_url']).not_to be_nil
+ expect(subject.production_events.first[:author_avatar_url]).not_to be_nil
end
it "has the author's name" do
- expect(subject.production_events.first['author_name']).to eq(context.author.name)
+ expect(subject.production_events.first[:author_name]).to eq(context.author.name)
end
end