summaryrefslogtreecommitdiff
path: root/spec/serializers/issue_board_entity_spec.rb
blob: 06d9d3657e66dc6d2ea423620545fe2d26362a0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'spec_helper'

describe IssueBoardEntity do
  let(:project)  { create(:project) }
  let(:resource) { create(:issue, project: project) }
  let(:user)     { create(:user) }

  let(:request) { double('request', current_user: user) }

  subject { described_class.new(resource, request: request).as_json }

  it 'has basic attributes' do
    expect(subject).to include(:id, :iid, :title, :confidential, :due_date, :project_id, :relative_position,
                               :project, :labels)
  end

  it 'has path and endpoints' do
    expect(subject).to include(:reference_path, :real_path, :issue_sidebar_endpoint,
                               :toggle_subscription_endpoint, :assignable_labels_endpoint)
  end
end