summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorVitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com>2017-09-16 20:51:02 +1100
committerVitaliy @blackst0ne Klachkov <blackst0ne.ru@gmail.com>2017-09-16 20:51:02 +1100
commitc0845e837dd6cfd2dac51581f7ebdd70532b862f (patch)
tree4077bfa0d1617ad2515a72e0943425e84f62fc7c /spec/requests
parent20295b3db379f4be02521cac591feca3452a2b1c (diff)
downloadgitlab-ce-c0845e837dd6cfd2dac51581f7ebdd70532b862f.tar.gz
Add 'closed_at' attribute to Issues API
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/issues_spec.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index 1583d1c2435..972e57bc373 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -22,7 +22,8 @@ describe API::Issues, :mailer do
state: :closed,
milestone: milestone,
created_at: generate(:past_time),
- updated_at: 3.hours.ago
+ updated_at: 3.hours.ago,
+ closed_at: 1.hour.ago
end
let!(:confidential_issue) do
create :issue,
@@ -738,6 +739,7 @@ describe API::Issues, :mailer do
expect(json_response['title']).to eq(issue.title)
expect(json_response['description']).to eq(issue.description)
expect(json_response['state']).to eq(issue.state)
+ expect(json_response['closed_at']).to be_falsy
expect(json_response['created_at']).to be_present
expect(json_response['updated_at']).to be_present
expect(json_response['labels']).to eq(issue.label_names)
@@ -748,6 +750,13 @@ describe API::Issues, :mailer do
expect(json_response['confidential']).to be_falsy
end
+ it "exposes the 'closed_at' attribute" do
+ get api("/projects/#{project.id}/issues/#{closed_issue.iid}", user)
+
+ expect(response).to have_http_status(200)
+ expect(json_response['closed_at']).to be_present
+ end
+
context 'links exposure' do
it 'exposes related resources full URIs' do
get api("/projects/#{project.id}/issues/#{issue.iid}", user)