diff options
| author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-03 09:46:53 +0100 |
|---|---|---|
| committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-11-03 09:46:53 +0100 |
| commit | 1bbeafc3e1a0e4472a0d8124c9d4711356cde2d0 (patch) | |
| tree | 1223af9ebd60b51e1903d0c27d716d1ff5bae639 /spec/serializers | |
| parent | 4477f7bb5925d8d720e3e8272bd882fffcc04b28 (diff) | |
| parent | d51ad1ea6407d3cb9eafd9fc891c7348b10b108f (diff) | |
| download | gitlab-ce-1bbeafc3e1a0e4472a0d8124c9d4711356cde2d0.tar.gz | |
Merge remote-tracking branch 'origin/master' into 38464-k8s-apps
Diffstat (limited to 'spec/serializers')
| -rw-r--r-- | spec/serializers/issue_entity_spec.rb | 20 | ||||
| -rw-r--r-- | spec/serializers/merge_request_entity_spec.rb | 11 |
2 files changed, 30 insertions, 1 deletions
diff --git a/spec/serializers/issue_entity_spec.rb b/spec/serializers/issue_entity_spec.rb new file mode 100644 index 00000000000..caa3e41402b --- /dev/null +++ b/spec/serializers/issue_entity_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe IssueEntity 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 Issuable attributes' do + expect(subject).to include(:id, :iid, :author_id, :description, :lock_version, :milestone_id, + :title, :updated_by_id, :created_at, :updated_at, :milestone, :labels) + end + + it 'has time estimation attributes' do + expect(subject).to include(:time_estimate, :total_time_spent, :human_time_estimate, :human_total_time_spent) + end +end diff --git a/spec/serializers/merge_request_entity_spec.rb b/spec/serializers/merge_request_entity_spec.rb index 87832b3dca1..f9285049c0d 100644 --- a/spec/serializers/merge_request_entity_spec.rb +++ b/spec/serializers/merge_request_entity_spec.rb @@ -30,8 +30,17 @@ describe MergeRequestEntity do :assign_to_closing) end + it 'has Issuable attributes' do + expect(subject).to include(:id, :iid, :author_id, :description, :lock_version, :milestone_id, + :title, :updated_by_id, :created_at, :updated_at, :milestone, :labels) + end + + it 'has time estimation attributes' do + expect(subject).to include(:time_estimate, :total_time_spent, :human_time_estimate, :human_total_time_spent) + end + it 'has important MergeRequest attributes' do - expect(subject).to include(:diff_head_sha, :merge_commit_message, + expect(subject).to include(:state, :deleted_at, :diff_head_sha, :merge_commit_message, :has_conflicts, :has_ci, :merge_path, :conflict_resolution_path, :cancel_merge_when_pipeline_succeeds_path, |
