diff options
author | Francesco Coda Zabetta <francesco.codazabetta@gmail.com> | 2016-11-15 11:50:39 +0300 |
---|---|---|
committer | Francesco Coda Zabetta <francesco.codazabetta@gmail.com> | 2016-11-15 11:50:39 +0300 |
commit | a58e2f4762d8f0fc52b0a4dc5a65c28258603c11 (patch) | |
tree | 10d86dc44b843dee4b4493fee48ee06a37e396b8 /spec | |
parent | 8fc771ab3ef86d77fe8a91774aa3e49333492ee5 (diff) |
use Enumerable#find insted of select + first
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/labels_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb index 64a99e42c28..151b5c33e3a 100644 --- a/spec/requests/api/labels_spec.rb +++ b/spec/requests/api/labels_spec.rb @@ -33,9 +33,9 @@ describe API::API, api: true do expect(json_response.first.keys).to match_array expected_keys expect(json_response.map { |l| l['name'] }).to match_array([group_label.name, priority_label.name, label1.name]) - label1_response = json_response.select { |l| l['name'] == label1.title }.first - group_label_response = json_response.select { |l| l['name'] == group_label.title }.first - priority_label_response = json_response.select { |l| l['name'] == priority_label.title }.first + label1_response = json_response.find { |l| l['name'] == label1.title } + group_label_response = json_response.find { |l| l['name'] == group_label.title } + priority_label_response = json_response.find { |l| l['name'] == priority_label.title } expect(label1_response['open_issues_count']).to eq(0) expect(label1_response['closed_issues_count']).to eq(1) |