traitify 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/lib/traitify/client/assessments.rb +10 -1
- data/lib/traitify/client/results.rb +4 -25
- data/lib/traitify/version.rb +1 -1
- data/spec/traitify-ruby/client/assessment_spec.rb +13 -0
- data/spec/traitify-ruby/client/result_spec.rb +3 -16
- metadata +2 -4
- data/spec/support/mocks/results_types_traits.json +0 -210
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16e81fc4cd0ea5276cfed2b6b1d230e858bde4b8
|
4
|
+
data.tar.gz: 100b5df294f239113aad8bd7444d0d33c0d12030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1cb94fd87a1137ebc5ffd35c31f1ce93f957c0372179121ad7503838d8c100a69282ff51447e1811758ae16d6883a046b16e252e32e1e53db220fbbc0cd6713
|
7
|
+
data.tar.gz: ae25afeebd9e32e239e00b78e2761175d796cace00e1bfe3b631fec6f298e5597b4ef6f35c436c695583f249d9f5735f931808f56808af4acf2b783f0f581e4f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
traitify (1.6.
|
4
|
+
traitify (1.6.2)
|
5
5
|
faraday (~> 0.9.0)
|
6
6
|
faraday_middleware (~> 0.9.0)
|
7
7
|
hashie
|
@@ -17,11 +17,11 @@ GEM
|
|
17
17
|
safe_yaml (~> 1.0.0)
|
18
18
|
debug_inspector (0.0.2)
|
19
19
|
diff-lcs (1.2.5)
|
20
|
-
faraday (0.9.
|
20
|
+
faraday (0.9.1)
|
21
21
|
multipart-post (>= 1.2, < 3)
|
22
22
|
faraday_middleware (0.9.1)
|
23
23
|
faraday (>= 0.7.4, < 0.10)
|
24
|
-
hashie (3.
|
24
|
+
hashie (3.4.0)
|
25
25
|
method_source (0.8.2)
|
26
26
|
multipart-post (2.0.0)
|
27
27
|
pry (0.10.0)
|
@@ -11,8 +11,17 @@ module Traitify
|
|
11
11
|
end
|
12
12
|
alias :find_assessment :assessment
|
13
13
|
|
14
|
-
|
14
|
+
def assessment_with_results(assessment_id, image_pack = nil, data = [])
|
15
|
+
image_pack ||= self.image_pack
|
16
|
+
|
17
|
+
response = image_pack ?
|
18
|
+
get("/assessments/#{assessment_id}?data=#{data.join(",")}&image_pack=#{image_pack}") :
|
19
|
+
get("/assessments/#{assessment_id}?data=#{data.join(",")}")
|
15
20
|
|
21
|
+
Hashie::Mash.new(response)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
16
25
|
def deck_id_from(options)
|
17
26
|
options[:deck_id] || deck_id
|
18
27
|
end
|
@@ -1,28 +1,14 @@
|
|
1
1
|
module Traitify
|
2
2
|
class Client
|
3
3
|
module Result
|
4
|
-
def results(assessment_id, image_pack = nil
|
4
|
+
def results(assessment_id, image_pack = nil)
|
5
5
|
image_pack ||= self.image_pack
|
6
|
-
old_results = false
|
7
|
-
if data.nil?
|
8
|
-
data = %w(types blend)
|
9
|
-
old_results = true
|
10
|
-
end
|
11
6
|
|
12
7
|
response = image_pack ?
|
13
|
-
get("/assessments/#{assessment_id}?
|
14
|
-
get("/assessments/#{assessment_id}
|
8
|
+
get("/assessments/#{assessment_id}/personality_types?image_pack=#{image_pack}") :
|
9
|
+
get("/assessments/#{assessment_id}/personality_types")
|
15
10
|
|
16
|
-
|
17
|
-
|
18
|
-
if old_results
|
19
|
-
OpenStruct.new({
|
20
|
-
personality_blend: result.personality_blend,
|
21
|
-
personality_types: result.personality_types
|
22
|
-
})
|
23
|
-
else
|
24
|
-
result
|
25
|
-
end
|
11
|
+
Hashie::Mash.new(response)
|
26
12
|
end
|
27
13
|
alias_method :find_results, :results
|
28
14
|
|
@@ -35,13 +21,6 @@ module Traitify
|
|
35
21
|
end
|
36
22
|
alias_method :find_assessment_personality_traits, :assessment_personality_traits
|
37
23
|
|
38
|
-
def raw_personality_traits(assessment_id)
|
39
|
-
get("/assessments/#{assessment_id}/personality_traits/raw").collect do |personality_trait|
|
40
|
-
Hashie::Mash.new(personality_trait)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
alias_method :find_personality_traits, :raw_personality_traits
|
44
|
-
|
45
24
|
def career_matches(assessment_id, number_of_matches=10)
|
46
25
|
response = get("/assessments/#{assessment_id}/matches/careers?number_of_matches=#{number_of_matches}")
|
47
26
|
response.collect { |career| Hashie::Mash.new(career) }
|
data/lib/traitify/version.rb
CHANGED
@@ -61,4 +61,17 @@ describe Traitify::Client do
|
|
61
61
|
expect(assessment.id).to eq("assessment-uuid")
|
62
62
|
end
|
63
63
|
end
|
64
|
+
|
65
|
+
describe ".assessment_with_results" do
|
66
|
+
let(:result) { tom.assessment_with_results("assessment-uuid", nil, %w(traits types blend)) }
|
67
|
+
|
68
|
+
before(:each) do
|
69
|
+
stub_it(:get, "/assessments/assessment-uuid?data=traits,types,blend", "assessment_with_results")
|
70
|
+
end
|
71
|
+
|
72
|
+
it "returns an assessment with results" do
|
73
|
+
expect(result.personality_types.first.personality_type.name).to eq("Analyzer")
|
74
|
+
expect(result.personality_traits.first.personality_trait.name).to eq("Imaginative")
|
75
|
+
end
|
76
|
+
end
|
64
77
|
end
|
@@ -16,7 +16,7 @@ describe Traitify::Client do
|
|
16
16
|
let(:result) { tom.find_results("assessment-uuid") }
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
stub_it(:get, "/assessments/assessment-uuid
|
19
|
+
stub_it(:get, "/assessments/assessment-uuid/personality_types", "result")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "returns a result" do
|
@@ -24,26 +24,13 @@ describe Traitify::Client do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
context "with data specified" do
|
28
|
-
let(:result) { tom.find_results("assessment-uuid", nil, %w(types traits)) }
|
29
|
-
|
30
|
-
before(:each) do
|
31
|
-
stub_it(:get, "/assessments/assessment-uuid?data=types,traits", "results_types_traits")
|
32
|
-
end
|
33
|
-
|
34
|
-
it "returns a result" do
|
35
|
-
expect(result.personality_types.first.personality_type.name).to eq("Analyzer")
|
36
|
-
expect(result.personality_traits.first.personality_trait.name).to eq("Imaginative")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
27
|
context "with an image pack" do
|
41
28
|
context "set in the configurations" do
|
42
29
|
let(:tom) { Traitify.new(image_pack: "full-color") }
|
43
30
|
let(:result) { tom.find_results("assessment-uuid") }
|
44
31
|
|
45
32
|
before(:each) do
|
46
|
-
stub_it(:get, "/assessments/assessment-uuid?
|
33
|
+
stub_it(:get, "/assessments/assessment-uuid/personality_types?image_pack=full-color", "result")
|
47
34
|
end
|
48
35
|
|
49
36
|
it "returns a result" do
|
@@ -55,7 +42,7 @@ describe Traitify::Client do
|
|
55
42
|
let(:result) { tom.find_results("assessment-uuid", "full-color") }
|
56
43
|
|
57
44
|
before(:each) do
|
58
|
-
stub_it(:get, "/assessments/assessment-uuid?
|
45
|
+
stub_it(:get, "/assessments/assessment-uuid/personality_types?image_pack=full-color", "result")
|
59
46
|
end
|
60
47
|
|
61
48
|
it "returns a result" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traitify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Prats
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -165,7 +165,6 @@ files:
|
|
165
165
|
- spec/support/mocks/decks.json
|
166
166
|
- spec/support/mocks/personality_traits.json
|
167
167
|
- spec/support/mocks/result.json
|
168
|
-
- spec/support/mocks/results_types_traits.json
|
169
168
|
- spec/support/mocks/slide.json
|
170
169
|
- spec/support/mocks/slides.json
|
171
170
|
- spec/support/mocks/slides_complete.json
|
@@ -205,7 +204,6 @@ test_files:
|
|
205
204
|
- spec/support/mocks/decks.json
|
206
205
|
- spec/support/mocks/personality_traits.json
|
207
206
|
- spec/support/mocks/result.json
|
208
|
-
- spec/support/mocks/results_types_traits.json
|
209
207
|
- spec/support/mocks/slide.json
|
210
208
|
- spec/support/mocks/slides.json
|
211
209
|
- spec/support/mocks/slides_complete.json
|
@@ -1,210 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"id": "assessment-uuid",
|
3
|
-
"deck_id": "deck-uuid",
|
4
|
-
"user_id": "toms-uuid",
|
5
|
-
"created_at": 1392153790744,
|
6
|
-
"completed_at": 1392153790744,
|
7
|
-
"personality_types": [
|
8
|
-
{
|
9
|
-
"personality_type": {
|
10
|
-
"id": "028095da-31c7-4ef9-8067-bcfe3f1cd549",
|
11
|
-
"name": "Analyzer",
|
12
|
-
"description": "Analyzers...are inquisitive. They delve, study and look deeply for information. They have a keen eye and an experimental nature. Analyzers use these capacities to figure out problems and search for the facts, often in a laboratory environment. They excel at going beyond the surface toward uncovering information and discovery.",
|
13
|
-
"badge": {
|
14
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/analyzer/full-color/small",
|
15
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/analayzer/full-color/medium",
|
16
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/analayzer/full-color/large",
|
17
|
-
"font_color": "fff",
|
18
|
-
"color_1": "81abf7",
|
19
|
-
"color_2": "6ea1ea",
|
20
|
-
"color_3": "1761ba"
|
21
|
-
}
|
22
|
-
},
|
23
|
-
"score": 67
|
24
|
-
},
|
25
|
-
{
|
26
|
-
"personality_type": {
|
27
|
-
"id": "2c9166c8-8c70-45d6-9c7b-7c975175b1fb",
|
28
|
-
"name": "Planner",
|
29
|
-
"description": "Planners...are the detail people. They are methodical, precise, and detail-oriented. Planners create systems to follow, and enjoy working with data, detail, words and numbers. Great at manipulating data, they love procedure and routine. Often found in office settings, they excel at completing detailed work in an organized manner.",
|
30
|
-
"badge": {
|
31
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/planner/full-color/small",
|
32
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/planner/full-color/medium",
|
33
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/planner/full-color/large",
|
34
|
-
"font_color": "fff",
|
35
|
-
"color_1": "ffed73",
|
36
|
-
"color_2": "f2df72",
|
37
|
-
"color_3": "f7d719"
|
38
|
-
}
|
39
|
-
},
|
40
|
-
"score": 67
|
41
|
-
},
|
42
|
-
{
|
43
|
-
"personality_type": {
|
44
|
-
"id": "02b7bbe5-1185-4443-9497-e916ae373a83",
|
45
|
-
"name": "Visionary",
|
46
|
-
"description": "Visionaries...are pioneers. They are great convincers and like to work with others in a “take charge” capacity. They love to take risks, make changes and set trends. They tend to be ambitious and energetic. Visionaries are often in positions of prominence in business and the public eye and excel at taking charge and gaining the confidence of others.",
|
47
|
-
"badge": {
|
48
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/visionary/flat/small",
|
49
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/visionary/flat/medium",
|
50
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/visionary/flat/large",
|
51
|
-
"font_color": "fff",
|
52
|
-
"color_1": "bc7def",
|
53
|
-
"color_2": "ac70e5",
|
54
|
-
"color_3": "5322a0"
|
55
|
-
}
|
56
|
-
},
|
57
|
-
"score": 67
|
58
|
-
},
|
59
|
-
{
|
60
|
-
"personality_type": {
|
61
|
-
"id": "f49525cc-59ba-4e2a-8dde-73ec1971d7ee",
|
62
|
-
"name": "Inventor",
|
63
|
-
"description": "Inventors...are creative. They take a contemporary, ‘out of the box’ approach to work and life. Inventors use themselves and other medium, often various forms of the arts, to communicate and interact with the world. Inventors excel when they are ‘lost in their work,’ completely engrossed in a project.",
|
64
|
-
"badge": {
|
65
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/inventor/full-color/small",
|
66
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/inventor/full-color/medium",
|
67
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/inventor/full-color/large",
|
68
|
-
"font_color": "fff",
|
69
|
-
"color_1": "7ff7e3",
|
70
|
-
"color_2": "74edd6",
|
71
|
-
"color_3": "26c6a7"
|
72
|
-
}
|
73
|
-
},
|
74
|
-
"score": 50
|
75
|
-
},
|
76
|
-
{
|
77
|
-
"personality_type": {
|
78
|
-
"id": "36c9af67-9447-4f4a-9d03-f6fb1f788f2d",
|
79
|
-
"name": "Action Taker",
|
80
|
-
"description": "Action-Takers...are hands-on doers. They use manual and physical skills, working with technology or machinery to complete tasks. Often there is an athletic aspect to their work. They are handy, practical, systematic, applied, and down-to-earth. They are drawn to jobs that involve a specific skill-set and a concrete task. They excel at solitary, goal-oriented work and getting the job done.",
|
81
|
-
"badge": {
|
82
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/action-taker/full-color/small",
|
83
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/action-taker/full-color/medium",
|
84
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/action-taker/full-color/large",
|
85
|
-
"font_color": "fff",
|
86
|
-
"color_1": "ffa466",
|
87
|
-
"color_2": "f79b5c",
|
88
|
-
"color_3": "ea813b"
|
89
|
-
}
|
90
|
-
},
|
91
|
-
"score": 17
|
92
|
-
},
|
93
|
-
{
|
94
|
-
"personality_type": {
|
95
|
-
"id": "9172e799-c971-4822-a3fe-660369eaeef5",
|
96
|
-
"name": "Mentor",
|
97
|
-
"description": "Mentors...are people-oriented. They have great communication skills and are most fulfilled when assisting or working directly with others to improve a personal or societal situation. Mentors are patient and compassionate and work best in a group or on a team toward a common goal. Mentors excel at working with others to help them learn and grow.",
|
98
|
-
"badge": {
|
99
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/mentor/full-color/small",
|
100
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/mentor/full-color/medium",
|
101
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/mentor/full-color/large",
|
102
|
-
"font_color": "fff",
|
103
|
-
"color_1": "f47171",
|
104
|
-
"color_2": "ea6c6c",
|
105
|
-
"color_3": "e24747"
|
106
|
-
}
|
107
|
-
},
|
108
|
-
"score": 0
|
109
|
-
},
|
110
|
-
{
|
111
|
-
"personality_type": {
|
112
|
-
"id": "9f1fd384-e321-48a4-b5f4-085b588af907",
|
113
|
-
"name": "Naturalist",
|
114
|
-
"description": "Naturalists...are attached to the natural world, frequently working with plants and animals in their environment. Often nature lovers, they like to experience the world outdoors. They are committed to preserving and protecting the planet and its natural resources. Serene, earthy, efficient and solid, they excel at working as one with the natural environment.",
|
115
|
-
"badge": {
|
116
|
-
"image_small": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/naturalist/full-color/small",
|
117
|
-
"image_medium": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/naturalist/full-color/medium",
|
118
|
-
"image_large": "https://traitify-api.s3.amazonaws.com/traitify-api/badges/naturalist/full-color/large",
|
119
|
-
"font_color": "fff",
|
120
|
-
"color_1": "6ad379",
|
121
|
-
"color_2": "5bc467",
|
122
|
-
"color_3": "317239"
|
123
|
-
}
|
124
|
-
},
|
125
|
-
"score": -17
|
126
|
-
}
|
127
|
-
],
|
128
|
-
"personality_traits": [
|
129
|
-
{
|
130
|
-
"personality_trait": {
|
131
|
-
"name": "Imaginative",
|
132
|
-
"definition": "Able to think symbolically and play with ideas.",
|
133
|
-
"description": ""
|
134
|
-
},
|
135
|
-
"score": 100.0
|
136
|
-
},
|
137
|
-
{
|
138
|
-
"personality_trait": {
|
139
|
-
"name": "Observant",
|
140
|
-
"definition": "keenly perceptive and aware of one's environment",
|
141
|
-
"description": ""
|
142
|
-
},
|
143
|
-
"score": 100.0
|
144
|
-
},
|
145
|
-
{
|
146
|
-
"personality_trait": {
|
147
|
-
"name": "Particular",
|
148
|
-
"definition": "has preferences that are exact and detailed",
|
149
|
-
"description": ""
|
150
|
-
},
|
151
|
-
"score": 100.0
|
152
|
-
},
|
153
|
-
{
|
154
|
-
"personality_trait": {
|
155
|
-
"name": "Superficial",
|
156
|
-
"definition": "likes to stay on the surface and not dig too deeply",
|
157
|
-
"description": ""
|
158
|
-
},
|
159
|
-
"score": 100.0
|
160
|
-
},
|
161
|
-
{
|
162
|
-
"personality_trait": {
|
163
|
-
"name": "Visionary",
|
164
|
-
"definition": "can imagine how actions and ideas pursued in the present will effect the future",
|
165
|
-
"description": ""
|
166
|
-
},
|
167
|
-
"score": 100.0
|
168
|
-
},
|
169
|
-
{
|
170
|
-
"personality_trait": {
|
171
|
-
"name": "Eclectic",
|
172
|
-
"definition": "Having a variety of blended interests, tastes, beliefs, style",
|
173
|
-
"description": ""
|
174
|
-
},
|
175
|
-
"score": 60.0
|
176
|
-
},
|
177
|
-
{
|
178
|
-
"personality_trait": {
|
179
|
-
"name": "Concrete",
|
180
|
-
"definition": "A style of thinking that values facts and real objects",
|
181
|
-
"description": ""
|
182
|
-
},
|
183
|
-
"score": 55.5556
|
184
|
-
},
|
185
|
-
{
|
186
|
-
"personality_trait": {
|
187
|
-
"name": "Focused",
|
188
|
-
"definition": "can concentrate one's mind, either because of a sense of drivenness, or as a result of interest or self-discipline",
|
189
|
-
"description": ""
|
190
|
-
},
|
191
|
-
"score": 23.0769
|
192
|
-
},
|
193
|
-
{
|
194
|
-
"personality_trait": {
|
195
|
-
"name": "Open-Minded",
|
196
|
-
"definition": "Having a mind receptive to new ideas or ideas contrary to one's own beliefs",
|
197
|
-
"description": ""
|
198
|
-
},
|
199
|
-
"score": 14.2857
|
200
|
-
},
|
201
|
-
{
|
202
|
-
"personality_trait": {
|
203
|
-
"name": "Realistic",
|
204
|
-
"definition": "has a real sense of what is practical and workable",
|
205
|
-
"description": ""
|
206
|
-
},
|
207
|
-
"score": -14.2857
|
208
|
-
}
|
209
|
-
]
|
210
|
-
}
|