traitify 1.6.2 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -0
- data/Gemfile.lock +23 -23
- data/lib/traitify/client.rb +12 -2
- data/lib/traitify/client/assessments.rb +0 -2
- data/lib/traitify/client/careers.rb +25 -0
- data/lib/traitify/configuration.rb +13 -3
- data/lib/traitify/connection.rb +1 -1
- data/lib/traitify/request.rb +3 -2
- data/lib/traitify/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/mocks/assessment_with_results.json +210 -0
- data/spec/support/mocks/career.json +13 -0
- data/spec/traitify-ruby/client/career_spec.rb +51 -0
- data/spec/traitify-ruby/client/configuration_spec.rb +51 -0
- data/traitify.gemspec +15 -15
- metadata +38 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024c9fecee85e2dc3b6766849603adb8204f4c7d
|
4
|
+
data.tar.gz: 097520a1a9cffc137319248cd3758cf6c60b2b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14e7a001292bd5f6bf7525ce1695fc5f203ff690ef254d6cc92a3c880958e22aa6a0974b41aefcaaa7f3fc5f52e36c7c6545eb3ec18bb11f8383720e4322b27e
|
7
|
+
data.tar.gz: 701372977fe6d08811fd50f4f9d990df8a9ca220ec5fa7d3d1571029ead06a358fd88baa5f45e1dda7cb73166702927a6cad23bc7659499353c952b98d5c2b37
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,45 @@
|
|
1
|
+
### 1.7.0
|
2
|
+
|
3
|
+
* Features
|
4
|
+
* Updated options to be consistent with other Traitify libraries
|
5
|
+
* Get career(s)
|
6
|
+
|
7
|
+
### 1.6.2
|
8
|
+
|
9
|
+
* Bug Fixes
|
10
|
+
* Move optional results data to assessments
|
11
|
+
|
12
|
+
### 1.6.1
|
13
|
+
|
14
|
+
* Bug Fixes
|
15
|
+
* Fix backwards compatibility with results
|
16
|
+
|
17
|
+
### 1.6.0
|
18
|
+
|
19
|
+
* Features
|
20
|
+
* Update results to handle optional data
|
21
|
+
|
22
|
+
### 1.5.0
|
23
|
+
|
24
|
+
* Features
|
25
|
+
* Catch server errors
|
26
|
+
|
27
|
+
### 1.4.0
|
28
|
+
|
29
|
+
* Features
|
30
|
+
* Improved error handling
|
31
|
+
|
32
|
+
### 1.3.0
|
33
|
+
|
34
|
+
* Features
|
35
|
+
* Get raw personality traits
|
36
|
+
|
37
|
+
### 1.2.0
|
38
|
+
|
39
|
+
* Features
|
40
|
+
* Get job matching
|
41
|
+
* Image packs option for decks
|
42
|
+
|
1
43
|
### 1.1.2
|
2
44
|
|
3
45
|
* Features
|
data/Gemfile.lock
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
traitify (1.6.
|
5
|
-
faraday (~> 0.9
|
6
|
-
faraday_middleware (~> 0.9
|
7
|
-
hashie
|
4
|
+
traitify (1.6.3)
|
5
|
+
faraday (~> 0.9)
|
6
|
+
faraday_middleware (~> 0.9)
|
7
|
+
hashie (~> 3.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
addressable (2.3.
|
12
|
+
addressable (2.3.7)
|
13
13
|
binding_of_caller (0.7.2)
|
14
14
|
debug_inspector (>= 0.0.1)
|
15
15
|
coderay (1.1.0)
|
@@ -24,33 +24,33 @@ GEM
|
|
24
24
|
hashie (3.4.0)
|
25
25
|
method_source (0.8.2)
|
26
26
|
multipart-post (2.0.0)
|
27
|
-
pry (0.10.
|
27
|
+
pry (0.10.1)
|
28
28
|
coderay (~> 1.1.0)
|
29
29
|
method_source (~> 0.8.1)
|
30
30
|
slop (~> 3.4)
|
31
|
-
rake (10.
|
32
|
-
rspec (2.
|
33
|
-
rspec-core (~> 2.
|
34
|
-
rspec-expectations (~> 2.
|
35
|
-
rspec-mocks (~> 2.
|
36
|
-
rspec-core (2.
|
37
|
-
rspec-expectations (2.
|
31
|
+
rake (10.4.2)
|
32
|
+
rspec (2.99.0)
|
33
|
+
rspec-core (~> 2.99.0)
|
34
|
+
rspec-expectations (~> 2.99.0)
|
35
|
+
rspec-mocks (~> 2.99.0)
|
36
|
+
rspec-core (2.99.2)
|
37
|
+
rspec-expectations (2.99.2)
|
38
38
|
diff-lcs (>= 1.1.3, < 2.0)
|
39
|
-
rspec-mocks (2.
|
40
|
-
safe_yaml (1.0.
|
41
|
-
slop (3.
|
42
|
-
webmock (1.
|
43
|
-
addressable (>= 2.
|
39
|
+
rspec-mocks (2.99.3)
|
40
|
+
safe_yaml (1.0.4)
|
41
|
+
slop (3.6.0)
|
42
|
+
webmock (1.20.4)
|
43
|
+
addressable (>= 2.3.6)
|
44
44
|
crack (>= 0.3.2)
|
45
45
|
|
46
46
|
PLATFORMS
|
47
47
|
ruby
|
48
48
|
|
49
49
|
DEPENDENCIES
|
50
|
-
binding_of_caller
|
50
|
+
binding_of_caller (~> 0.7)
|
51
51
|
bundler (~> 1.3)
|
52
|
-
pry
|
53
|
-
rake (~> 10.1
|
54
|
-
rspec (~> 2.14
|
52
|
+
pry (~> 0.10)
|
53
|
+
rake (~> 10.1)
|
54
|
+
rspec (~> 2.14)
|
55
55
|
traitify!
|
56
|
-
webmock (~> 1.13
|
56
|
+
webmock (~> 1.13)
|
data/lib/traitify/client.rb
CHANGED
@@ -9,11 +9,20 @@ module Traitify
|
|
9
9
|
class Client
|
10
10
|
attr_accessor(*Configuration::VALID_OPTIONS_KEYS)
|
11
11
|
|
12
|
+
alias_method :api_host, :host
|
13
|
+
alias_method :api_host=, :host=
|
14
|
+
|
15
|
+
alias_method :api_version, :version
|
16
|
+
alias_method :api_version=, :version=
|
17
|
+
|
18
|
+
alias_method :secret, :secret_key
|
19
|
+
alias_method :secret=, :secret_key=
|
20
|
+
|
12
21
|
def initialize(options = {})
|
13
22
|
options = Traitify.options.merge(options)
|
14
23
|
|
15
|
-
|
16
|
-
send("#{key}=",
|
24
|
+
options.each do |key, value|
|
25
|
+
send("#{key}=", value) unless value.nil?
|
17
26
|
end
|
18
27
|
end
|
19
28
|
|
@@ -25,5 +34,6 @@ module Traitify
|
|
25
34
|
include Traitify::Client::Assessment
|
26
35
|
include Traitify::Client::Slide
|
27
36
|
include Traitify::Client::Result
|
37
|
+
include Traitify::Client::Career
|
28
38
|
end
|
29
39
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Traitify
|
2
|
+
class Client
|
3
|
+
module Career
|
4
|
+
# Valid options are
|
5
|
+
# - page
|
6
|
+
# - careers_per_page
|
7
|
+
# - experience_levels
|
8
|
+
def careers(options = {})
|
9
|
+
response = options.empty? ?
|
10
|
+
get("/careers") :
|
11
|
+
get("/careers?" + options.collect{ |k,v| "#{k}=#{v}" }.join("&"))
|
12
|
+
|
13
|
+
response.collect { |career| Hashie::Mash.new(career) }
|
14
|
+
end
|
15
|
+
alias_method :find_careers, :careers
|
16
|
+
|
17
|
+
def career(id)
|
18
|
+
response = get("/careers/#{id}")
|
19
|
+
|
20
|
+
Hashie::Mash.new(response)
|
21
|
+
end
|
22
|
+
alias_method :find_career, :career
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,15 +1,25 @@
|
|
1
1
|
module Traitify
|
2
2
|
module Configuration
|
3
3
|
VALID_OPTIONS_KEYS = [
|
4
|
-
:
|
5
|
-
:
|
6
|
-
:
|
4
|
+
:host,
|
5
|
+
:public_key,
|
6
|
+
:secret_key,
|
7
|
+
:version,
|
7
8
|
:deck_id,
|
8
9
|
:image_pack
|
9
10
|
]
|
10
11
|
|
11
12
|
attr_accessor(*VALID_OPTIONS_KEYS)
|
12
13
|
|
14
|
+
alias_method :api_host, :host
|
15
|
+
alias_method :api_host=, :host=
|
16
|
+
|
17
|
+
alias_method :api_version, :version
|
18
|
+
alias_method :api_version=, :version=
|
19
|
+
|
20
|
+
alias_method :secret, :secret_key
|
21
|
+
alias_method :secret=, :secret_key=
|
22
|
+
|
13
23
|
def configure
|
14
24
|
yield self
|
15
25
|
end
|
data/lib/traitify/connection.rb
CHANGED
@@ -6,7 +6,7 @@ module Traitify
|
|
6
6
|
def conn(options = {})
|
7
7
|
Faraday.new(options) do |faraday|
|
8
8
|
faraday.request :url_encoded
|
9
|
-
faraday.request :basic_auth, self.
|
9
|
+
faraday.request :basic_auth, self.secret_key, "x"
|
10
10
|
faraday.use ContentTypeMiddleware
|
11
11
|
faraday.use ErrorMiddleware
|
12
12
|
faraday.response :json, :content_type => /\bjson$/
|
data/lib/traitify/request.rb
CHANGED
@@ -10,12 +10,13 @@ module Traitify
|
|
10
10
|
|
11
11
|
def request(method, path, options = {})
|
12
12
|
begin
|
13
|
-
conn(url:
|
14
|
-
request.url [
|
13
|
+
conn(url: host).send(method) do |request|
|
14
|
+
request.url [version, path].join
|
15
15
|
request.body = options.to_json if options
|
16
16
|
end.body
|
17
17
|
rescue => e
|
18
18
|
puts e.message
|
19
|
+
puts e.inspect
|
19
20
|
{ error: e.message }
|
20
21
|
end
|
21
22
|
end
|
data/lib/traitify/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -0,0 +1,210 @@
|
|
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
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Traitify::Client do
|
4
|
+
before do
|
5
|
+
Traitify.configure do |tom|
|
6
|
+
tom.secret = "secret"
|
7
|
+
tom.api_host = "https://example.com"
|
8
|
+
tom.api_version = "v1"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
let(:tom) { Traitify.new }
|
13
|
+
|
14
|
+
describe ".careers" do
|
15
|
+
context "without params" do
|
16
|
+
let(:careers) { tom.careers }
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
stub_it(:get, "/careers", "careers")
|
20
|
+
end
|
21
|
+
|
22
|
+
it "returns careers" do
|
23
|
+
expect(careers.first.title).to eq("Career Title")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "with params" do
|
28
|
+
let(:careers) { tom.careers(page: 1, careers_per_page: 50) }
|
29
|
+
|
30
|
+
before(:each) do
|
31
|
+
stub_it(:get, "/careers?careers_per_page=50&page=1", "careers")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "returns careers" do
|
35
|
+
expect(careers.first.title).to eq("Career Title")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe ".career" do
|
41
|
+
let(:career) { tom.career("career-id") }
|
42
|
+
|
43
|
+
before(:each) do
|
44
|
+
stub_it(:get, "/careers/career-id", "career")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "returns career" do
|
48
|
+
expect(career.title).to eq("Career Title")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Traitify::Client do
|
4
|
+
let(:tom) { Traitify.new }
|
5
|
+
|
6
|
+
context "using old setters" do
|
7
|
+
before do
|
8
|
+
Traitify.configure do |tom|
|
9
|
+
tom.secret = "secret"
|
10
|
+
tom.api_host = "https://example.com"
|
11
|
+
tom.api_version = "v1"
|
12
|
+
tom.deck_id = "deck-uuid"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
it "assigns secret_key" do
|
17
|
+
expect(tom.secret_key).to eq("secret")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "assigns host" do
|
21
|
+
expect(tom.host).to eq("https://example.com")
|
22
|
+
end
|
23
|
+
|
24
|
+
it "assigns version" do
|
25
|
+
expect(tom.version).to eq("v1")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context "using new setters" do
|
30
|
+
before do
|
31
|
+
Traitify.configure do |tom|
|
32
|
+
tom.secret_key = "secret"
|
33
|
+
tom.host = "https://example.com"
|
34
|
+
tom.version = "v1"
|
35
|
+
tom.deck_id = "deck-uuid"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
it "assigns secret" do
|
40
|
+
expect(tom.secret).to eq("secret")
|
41
|
+
end
|
42
|
+
|
43
|
+
it "assigns api_host" do
|
44
|
+
expect(tom.api_host).to eq("https://example.com")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "assigns api_version" do
|
48
|
+
expect(tom.api_version).to eq("v1")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/traitify.gemspec
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
lib = File.expand_path(
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require
|
3
|
+
require "traitify/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "traitify"
|
7
7
|
spec.version = Traitify::VERSION
|
8
|
-
spec.
|
9
|
-
spec.
|
10
|
-
spec.description =
|
11
|
-
spec.
|
8
|
+
spec.licenses = ["MIT"]
|
9
|
+
spec.summary = "Traitify Gem"
|
10
|
+
spec.description = "Traitify is a ruby gem wrapper for the Traitify API"
|
11
|
+
spec.authors = ["Tom Prats", "Eric Fleming"]
|
12
|
+
spec.email = "tom@traitify.com"
|
12
13
|
spec.homepage = "https://www.traitify.com"
|
13
|
-
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.add_dependency "hashie"
|
21
|
-
spec.add_dependency "faraday", "~> 0.9
|
22
|
-
spec.add_dependency "faraday_middleware", "~> 0.9
|
20
|
+
spec.add_dependency "hashie", "~> 3.0"
|
21
|
+
spec.add_dependency "faraday", "~> 0.9"
|
22
|
+
spec.add_dependency "faraday_middleware", "~> 0.9"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
|
-
spec.add_development_dependency "rake", "~> 10.1
|
26
|
-
spec.add_development_dependency "rspec", "~> 2.14
|
27
|
-
spec.add_development_dependency "pry"
|
28
|
-
spec.add_development_dependency "binding_of_caller"
|
29
|
-
spec.add_development_dependency "webmock", "~> 1.13
|
25
|
+
spec.add_development_dependency "rake", "~> 10.1"
|
26
|
+
spec.add_development_dependency "rspec", "~> 2.14"
|
27
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
28
|
+
spec.add_development_dependency "binding_of_caller", "~> 0.7"
|
29
|
+
spec.add_development_dependency "webmock", "~> 1.13"
|
30
30
|
end
|
metadata
CHANGED
@@ -1,57 +1,58 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traitify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Prats
|
8
|
+
- Eric Fleming
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
12
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: hashie
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
16
17
|
requirements:
|
17
|
-
- - "
|
18
|
+
- - "~>"
|
18
19
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
+
version: '3.0'
|
20
21
|
type: :runtime
|
21
22
|
prerelease: false
|
22
23
|
version_requirements: !ruby/object:Gem::Requirement
|
23
24
|
requirements:
|
24
|
-
- - "
|
25
|
+
- - "~>"
|
25
26
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
27
|
+
version: '3.0'
|
27
28
|
- !ruby/object:Gem::Dependency
|
28
29
|
name: faraday
|
29
30
|
requirement: !ruby/object:Gem::Requirement
|
30
31
|
requirements:
|
31
32
|
- - "~>"
|
32
33
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.9
|
34
|
+
version: '0.9'
|
34
35
|
type: :runtime
|
35
36
|
prerelease: false
|
36
37
|
version_requirements: !ruby/object:Gem::Requirement
|
37
38
|
requirements:
|
38
39
|
- - "~>"
|
39
40
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.9
|
41
|
+
version: '0.9'
|
41
42
|
- !ruby/object:Gem::Dependency
|
42
43
|
name: faraday_middleware
|
43
44
|
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
46
|
- - "~>"
|
46
47
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.9
|
48
|
+
version: '0.9'
|
48
49
|
type: :runtime
|
49
50
|
prerelease: false
|
50
51
|
version_requirements: !ruby/object:Gem::Requirement
|
51
52
|
requirements:
|
52
53
|
- - "~>"
|
53
54
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9
|
55
|
+
version: '0.9'
|
55
56
|
- !ruby/object:Gem::Dependency
|
56
57
|
name: bundler
|
57
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,72 +73,72 @@ dependencies:
|
|
72
73
|
requirements:
|
73
74
|
- - "~>"
|
74
75
|
- !ruby/object:Gem::Version
|
75
|
-
version: 10.1
|
76
|
+
version: '10.1'
|
76
77
|
type: :development
|
77
78
|
prerelease: false
|
78
79
|
version_requirements: !ruby/object:Gem::Requirement
|
79
80
|
requirements:
|
80
81
|
- - "~>"
|
81
82
|
- !ruby/object:Gem::Version
|
82
|
-
version: 10.1
|
83
|
+
version: '10.1'
|
83
84
|
- !ruby/object:Gem::Dependency
|
84
85
|
name: rspec
|
85
86
|
requirement: !ruby/object:Gem::Requirement
|
86
87
|
requirements:
|
87
88
|
- - "~>"
|
88
89
|
- !ruby/object:Gem::Version
|
89
|
-
version: 2.14
|
90
|
+
version: '2.14'
|
90
91
|
type: :development
|
91
92
|
prerelease: false
|
92
93
|
version_requirements: !ruby/object:Gem::Requirement
|
93
94
|
requirements:
|
94
95
|
- - "~>"
|
95
96
|
- !ruby/object:Gem::Version
|
96
|
-
version: 2.14
|
97
|
+
version: '2.14'
|
97
98
|
- !ruby/object:Gem::Dependency
|
98
99
|
name: pry
|
99
100
|
requirement: !ruby/object:Gem::Requirement
|
100
101
|
requirements:
|
101
|
-
- - "
|
102
|
+
- - "~>"
|
102
103
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
+
version: '0.10'
|
104
105
|
type: :development
|
105
106
|
prerelease: false
|
106
107
|
version_requirements: !ruby/object:Gem::Requirement
|
107
108
|
requirements:
|
108
|
-
- - "
|
109
|
+
- - "~>"
|
109
110
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
+
version: '0.10'
|
111
112
|
- !ruby/object:Gem::Dependency
|
112
113
|
name: binding_of_caller
|
113
114
|
requirement: !ruby/object:Gem::Requirement
|
114
115
|
requirements:
|
115
|
-
- - "
|
116
|
+
- - "~>"
|
116
117
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
+
version: '0.7'
|
118
119
|
type: :development
|
119
120
|
prerelease: false
|
120
121
|
version_requirements: !ruby/object:Gem::Requirement
|
121
122
|
requirements:
|
122
|
-
- - "
|
123
|
+
- - "~>"
|
123
124
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
+
version: '0.7'
|
125
126
|
- !ruby/object:Gem::Dependency
|
126
127
|
name: webmock
|
127
128
|
requirement: !ruby/object:Gem::Requirement
|
128
129
|
requirements:
|
129
130
|
- - "~>"
|
130
131
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.13
|
132
|
+
version: '1.13'
|
132
133
|
type: :development
|
133
134
|
prerelease: false
|
134
135
|
version_requirements: !ruby/object:Gem::Requirement
|
135
136
|
requirements:
|
136
137
|
- - "~>"
|
137
138
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.13
|
139
|
-
description: Traitify
|
140
|
-
email: tom@
|
139
|
+
version: '1.13'
|
140
|
+
description: Traitify is a ruby gem wrapper for the Traitify API
|
141
|
+
email: tom@traitify.com
|
141
142
|
executables: []
|
142
143
|
extensions: []
|
143
144
|
extra_rdoc_files: []
|
@@ -151,6 +152,7 @@ files:
|
|
151
152
|
- lib/traitify.rb
|
152
153
|
- lib/traitify/client.rb
|
153
154
|
- lib/traitify/client/assessments.rb
|
155
|
+
- lib/traitify/client/careers.rb
|
154
156
|
- lib/traitify/client/decks.rb
|
155
157
|
- lib/traitify/client/results.rb
|
156
158
|
- lib/traitify/client/slides.rb
|
@@ -161,6 +163,8 @@ files:
|
|
161
163
|
- lib/traitify/version.rb
|
162
164
|
- spec/spec_helper.rb
|
163
165
|
- spec/support/mocks/assessment.json
|
166
|
+
- spec/support/mocks/assessment_with_results.json
|
167
|
+
- spec/support/mocks/career.json
|
164
168
|
- spec/support/mocks/careers.json
|
165
169
|
- spec/support/mocks/decks.json
|
166
170
|
- spec/support/mocks/personality_traits.json
|
@@ -169,6 +173,8 @@ files:
|
|
169
173
|
- spec/support/mocks/slides.json
|
170
174
|
- spec/support/mocks/slides_complete.json
|
171
175
|
- spec/traitify-ruby/client/assessment_spec.rb
|
176
|
+
- spec/traitify-ruby/client/career_spec.rb
|
177
|
+
- spec/traitify-ruby/client/configuration_spec.rb
|
172
178
|
- spec/traitify-ruby/client/deck_spec.rb
|
173
179
|
- spec/traitify-ruby/client/result_spec.rb
|
174
180
|
- spec/traitify-ruby/client/slide_spec.rb
|
@@ -196,10 +202,12 @@ rubyforge_project:
|
|
196
202
|
rubygems_version: 2.2.2
|
197
203
|
signing_key:
|
198
204
|
specification_version: 4
|
199
|
-
summary: Traitify
|
205
|
+
summary: Traitify Gem
|
200
206
|
test_files:
|
201
207
|
- spec/spec_helper.rb
|
202
208
|
- spec/support/mocks/assessment.json
|
209
|
+
- spec/support/mocks/assessment_with_results.json
|
210
|
+
- spec/support/mocks/career.json
|
203
211
|
- spec/support/mocks/careers.json
|
204
212
|
- spec/support/mocks/decks.json
|
205
213
|
- spec/support/mocks/personality_traits.json
|
@@ -208,6 +216,9 @@ test_files:
|
|
208
216
|
- spec/support/mocks/slides.json
|
209
217
|
- spec/support/mocks/slides_complete.json
|
210
218
|
- spec/traitify-ruby/client/assessment_spec.rb
|
219
|
+
- spec/traitify-ruby/client/career_spec.rb
|
220
|
+
- spec/traitify-ruby/client/configuration_spec.rb
|
211
221
|
- spec/traitify-ruby/client/deck_spec.rb
|
212
222
|
- spec/traitify-ruby/client/result_spec.rb
|
213
223
|
- spec/traitify-ruby/client/slide_spec.rb
|
224
|
+
has_rdoc:
|