summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-04-03 14:36:57 +0100
committerRémy Coutable <remy@rymai.me>2017-04-14 15:20:55 +0200
commitcc677c8f8ce038610018e43fd41d238a3bf73ff3 (patch)
tree4d28c98e9861eee1c327d24b9a232f7264121661 /spec/services
parent44f3fc499a333c1ba43f845f3cbbe87f8f75fbca (diff)
downloadgitlab-ce-cc677c8f8ce038610018e43fd41d238a3bf73ff3.tar.gz
Make UserCohortsService more understandable
1. Extract out into several methods. 2. Add more comments describing the data and the shape of the data.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/user_cohorts_service_spec.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/spec/services/user_cohorts_service_spec.rb b/spec/services/user_cohorts_service_spec.rb
index 8d8d0de31cd..4db8d577d79 100644
--- a/spec/services/user_cohorts_service_spec.rb
+++ b/spec/services/user_cohorts_service_spec.rb
@@ -32,11 +32,7 @@ describe UserCohortsService do
month_start(0) => { months: [2], total: 2, inactive: 1 }
}
- result = described_class.new.execute(12)
-
- expect(result.length).to eq(12)
- expect(result.keys).to all(be_a(Date))
- expect(result).to eq(expected)
+ expect(described_class.new.execute).to eq(expected)
end
end
end