Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/bitbucket_server/representation/activity_spec.rb')
-rw-r--r--spec/lib/bitbucket_server/representation/activity_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/lib/bitbucket_server/representation/activity_spec.rb b/spec/lib/bitbucket_server/representation/activity_spec.rb
index 0b7e4542cbe..ee0486ab210 100644
--- a/spec/lib/bitbucket_server/representation/activity_spec.rb
+++ b/spec/lib/bitbucket_server/representation/activity_spec.rb
@@ -2,11 +2,12 @@
require 'spec_helper'
-RSpec.describe BitbucketServer::Representation::Activity do
+RSpec.describe BitbucketServer::Representation::Activity, feature_category: :importers do
let(:activities) { Gitlab::Json.parse(fixture_file('importers/bitbucket_server/activities.json'))['values'] }
let(:inline_comment) { activities.first }
let(:comment) { activities[3] }
let(:merge_event) { activities[4] }
+ let(:approved_event) { activities[8] }
describe 'regular comment' do
subject { described_class.new(comment) }
@@ -37,4 +38,17 @@ RSpec.describe BitbucketServer::Representation::Activity do
it { expect(subject.created_at).to be_a(Time) }
it { expect(subject.merge_commit).to eq('839fa9a2d434eb697815b8fcafaecc51accfdbbc') }
end
+
+ describe 'approved event' do
+ subject { described_class.new(approved_event) }
+
+ it { expect(subject.id).to eq(15) }
+ it { expect(subject.comment?).to be_falsey }
+ it { expect(subject.inline_comment?).to be_falsey }
+ it { expect(subject.merge_event?).to be_falsey }
+ it { expect(subject.approved_event?).to be_truthy }
+ it { expect(subject.approver_username).to eq('slug') }
+ it { expect(subject.approver_email).to eq('test.user@example.com') }
+ it { expect(subject.created_at).to be_a(Time) }
+ end
end