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

subscription_entity_spec.rb « jira_connect « serializers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5d5d6d585f2522eeaadb542e507f98f95be91af0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe JiraConnect::SubscriptionEntity do
  subject do
    described_class.new(subscription).as_json
  end

  let(:subscription) { create(:jira_connect_subscription) }

  it 'contains all necessary elements of the subscription', :aggregate_failures do
    expect(subject).to include(:created_at)
    expect(subject[:unlink_path]).to eq("/-/jira_connect/subscriptions/#{subscription.id}")
    expect(subject[:group]).to eq(
      name: subscription.namespace.name,
      avatar_url: subscription.namespace.avatar_url,
      full_name: subscription.namespace.full_name,
      description: subscription.namespace.description
    )
  end
end