diff options
author | Brett Walker <bwalker@gitlab.com> | 2018-12-03 18:23:38 +0300 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2018-12-04 17:44:21 +0300 |
commit | 2674830e4df3f6509bd63ebfd048bc6a4e7053ab (patch) | |
tree | ddf982d821a7ce32d275f841f6ce3fb14f5a78a9 /spec/serializers/issue_board_entity_spec.rb | |
parent | bba23151a1c0b4dff8f2c31301c5d0589876251d (diff) |
Extract code into IssueBoardEntity
Diffstat (limited to 'spec/serializers/issue_board_entity_spec.rb')
-rw-r--r-- | spec/serializers/issue_board_entity_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/serializers/issue_board_entity_spec.rb b/spec/serializers/issue_board_entity_spec.rb new file mode 100644 index 00000000000..06d9d3657e6 --- /dev/null +++ b/spec/serializers/issue_board_entity_spec.rb @@ -0,0 +1,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 |