traitify 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -7
- data/Gemfile +1 -1
- data/Gemfile.lock +2 -0
- data/README.md +58 -69
- data/lib/traitify/client.rb +3 -9
- data/lib/traitify/client/assessments.rb +6 -6
- data/lib/traitify/client/decks.rb +12 -0
- data/lib/traitify/client/results.rb +14 -2
- data/lib/traitify/client/slides.rb +12 -19
- data/lib/traitify/error.rb +3 -5
- data/lib/traitify/version.rb +1 -1
- data/spec/support/mocks/decks.json +12 -0
- data/spec/support/mocks/personality_traits.json +82 -0
- data/spec/support/mocks/slide.json +1 -1
- data/spec/support/mocks/slides.json +1 -1
- data/spec/support/mocks/slides_complete.json +1 -1
- data/spec/traitify-ruby/client/deck_spec.rb +28 -0
- data/spec/traitify-ruby/client/result_spec.rb +27 -1
- data/spec/traitify-ruby/client/slide_spec.rb +18 -23
- data/traitify.gemspec +1 -0
- metadata +44 -34
- data/lib/traitify/assessments.rb +0 -36
- data/lib/traitify/badges.rb +0 -43
- data/lib/traitify/client/users.rb +0 -17
- data/lib/traitify/personality_blends.rb +0 -55
- data/lib/traitify/personality_types.rb +0 -39
- data/lib/traitify/results.rb +0 -31
- data/lib/traitify/slides.rb +0 -95
- data/lib/traitify/users.rb +0 -39
- data/spec/support/mocks/user.json +0 -8
- data/spec/traitify-ruby/client/user_spec.rb +0 -41
@@ -0,0 +1,82 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"personality_trait": {
|
4
|
+
"name": "Imaginative",
|
5
|
+
"definition": "Able to think symbolically and play with ideas.",
|
6
|
+
"description": ""
|
7
|
+
},
|
8
|
+
"score": 100.0
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"personality_trait": {
|
12
|
+
"name": "Observant",
|
13
|
+
"definition": "keenly perceptive and aware of one's environment",
|
14
|
+
"description": ""
|
15
|
+
},
|
16
|
+
"score": 100.0
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"personality_trait": {
|
20
|
+
"name": "Particular",
|
21
|
+
"definition": "has preferences that are exact and detailed",
|
22
|
+
"description": ""
|
23
|
+
},
|
24
|
+
"score": 100.0
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"personality_trait": {
|
28
|
+
"name": "Superficial",
|
29
|
+
"definition": "likes to stay on the surface and not dig too deeply",
|
30
|
+
"description": ""
|
31
|
+
},
|
32
|
+
"score": 100.0
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"personality_trait": {
|
36
|
+
"name": "Visionary",
|
37
|
+
"definition": "can imagine how actions and ideas pursued in the present will effect the future",
|
38
|
+
"description": ""
|
39
|
+
},
|
40
|
+
"score": 100.0
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"personality_trait": {
|
44
|
+
"name": "Eclectic",
|
45
|
+
"definition": "Having a variety of blended interests, tastes, beliefs, style",
|
46
|
+
"description": ""
|
47
|
+
},
|
48
|
+
"score": 60.0
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"personality_trait": {
|
52
|
+
"name": "Concrete",
|
53
|
+
"definition": "A style of thinking that values facts and real objects",
|
54
|
+
"description": ""
|
55
|
+
},
|
56
|
+
"score": 55.5556
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"personality_trait": {
|
60
|
+
"name": "Focused",
|
61
|
+
"definition": "can concentrate one's mind, either because of a sense of drivenness, or as a result of interest or self-discipline",
|
62
|
+
"description": ""
|
63
|
+
},
|
64
|
+
"score": 23.0769
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"personality_trait": {
|
68
|
+
"name": "Open-Minded",
|
69
|
+
"definition": "Having a mind receptive to new ideas or ideas contrary to one's own beliefs",
|
70
|
+
"description": ""
|
71
|
+
},
|
72
|
+
"score": 14.2857
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"personality_trait": {
|
76
|
+
"name": "Realistic",
|
77
|
+
"definition": "has a real sense of what is practical and workable",
|
78
|
+
"description": ""
|
79
|
+
},
|
80
|
+
"score": -14.2857
|
81
|
+
}
|
82
|
+
]
|
@@ -0,0 +1,28 @@
|
|
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
|
+
tom.deck_id = "deck-uuid"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:tom) { Traitify.new }
|
14
|
+
|
15
|
+
describe ".create_assessment" do
|
16
|
+
context "without a user" do
|
17
|
+
let(:decks) { tom.decks }
|
18
|
+
|
19
|
+
before(:each) do
|
20
|
+
stub_it(:get, "/decks", "decks")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "returns an array of decks" do
|
24
|
+
expect(decks.first.id).to eq("deck-uuid")
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -20,7 +20,7 @@ describe Traitify::Client do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "returns a result" do
|
23
|
-
expect(result.personality_types.first.name).to eq("Analyzer")
|
23
|
+
expect(result.personality_types.first.personality_type.name).to eq("Analyzer")
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -51,4 +51,30 @@ describe Traitify::Client do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
describe ".assessment_personality_type" do
|
56
|
+
context "with a personality type" do
|
57
|
+
let(:personality_traits) { tom.assessment_personality_traits("assessment-uuid", "personality-type-uuid") }
|
58
|
+
|
59
|
+
before(:each) do
|
60
|
+
stub_it(:get, "/assessments/assessment-uuid/personality_types/personality-type-uuid/personality_traits", "personality_traits")
|
61
|
+
end
|
62
|
+
|
63
|
+
it "returns a result" do
|
64
|
+
expect(personality_traits.first.personality_trait.name).to eq("Imaginative")
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
context "without a personality type" do
|
69
|
+
let(:personality_traits) { tom.assessment_personality_traits("assessment-uuid") }
|
70
|
+
|
71
|
+
before(:each) do
|
72
|
+
stub_it(:get, "/assessments/assessment-uuid/personality_traits", "personality_traits")
|
73
|
+
end
|
74
|
+
|
75
|
+
it "returns a result" do
|
76
|
+
expect(personality_traits.first.personality_trait.name).to eq("Imaginative")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
54
80
|
end
|
@@ -19,18 +19,14 @@ describe Traitify::Client do
|
|
19
19
|
stub_it(:get, "/assessments/assessment-uuid/slides", "slides")
|
20
20
|
end
|
21
21
|
|
22
|
-
it "returns
|
23
|
-
expect(slides.
|
24
|
-
end
|
25
|
-
|
26
|
-
it "returns slides' assessment uuid" do
|
27
|
-
expect(slides.assessment_id).to eq("assessment-uuid")
|
22
|
+
it "returns each slide's uuid" do
|
23
|
+
expect(slides.first.id).to eq("slide-uuid")
|
28
24
|
end
|
29
25
|
end
|
30
26
|
|
31
27
|
describe ".update_slides" do
|
32
28
|
let(:slides) { tom.find_slides("assessment-uuid") }
|
33
|
-
let(:slides_complete) { tom.update_slides(slides) }
|
29
|
+
let(:slides_complete) { tom.update_slides("assessment-uuid", slides) }
|
34
30
|
|
35
31
|
before(:each) do
|
36
32
|
stub_it(:get, "/assessments/assessment-uuid/slides", "slides")
|
@@ -47,36 +43,35 @@ describe Traitify::Client do
|
|
47
43
|
end
|
48
44
|
|
49
45
|
describe ".update_slide" do
|
50
|
-
context "with
|
46
|
+
context "with hash" do
|
51
47
|
let(:slides) { tom.find_slides("assessment-uuid") }
|
52
|
-
let(:slide) {
|
53
|
-
|
48
|
+
let(:slide) { tom.update_slide("assessment-uuid", {
|
49
|
+
id: slides.first.id,
|
50
|
+
response: true,
|
51
|
+
time_taken: 1000
|
52
|
+
})}
|
54
53
|
|
55
54
|
before(:each) do
|
56
55
|
stub_it(:get, "/assessments/assessment-uuid/slides", "slides")
|
57
|
-
stub_it(:put, "/assessments/assessment-uuid/slides/
|
58
|
-
|
59
|
-
slide.response = 0
|
60
|
-
slide.time_taken = 1000
|
56
|
+
stub_it(:put, "/assessments/assessment-uuid/slides/slide-uuid", "slide")
|
61
57
|
end
|
62
58
|
|
63
59
|
it "returns a slide" do
|
64
|
-
expect(
|
60
|
+
expect(slide.response).to eq(true)
|
65
61
|
end
|
66
62
|
end
|
67
63
|
|
68
|
-
context "with
|
64
|
+
context "with slide" do
|
69
65
|
let(:slides) { tom.find_slides("assessment-uuid") }
|
70
|
-
let(:slide) {
|
71
|
-
assessment_id: slides.assessment_id,
|
72
|
-
slide_id: slides.first.id,
|
73
|
-
response: 0,
|
74
|
-
time_taken: 1000
|
75
|
-
)}
|
66
|
+
let(:slide) { slides.first }
|
76
67
|
|
77
68
|
before(:each) do
|
78
69
|
stub_it(:get, "/assessments/assessment-uuid/slides", "slides")
|
79
|
-
stub_it(:put, "/assessments/assessment-uuid/slides/
|
70
|
+
stub_it(:put, "/assessments/assessment-uuid/slides/slide-uuid", "slide")
|
71
|
+
|
72
|
+
slide.response = true
|
73
|
+
slide.time_taken = 1000
|
74
|
+
tom.update_slide("assessment-uuid", slide)
|
80
75
|
end
|
81
76
|
|
82
77
|
it "returns a slide" do
|
data/traitify.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
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"
|
20
21
|
spec.add_dependency "faraday", "~> 0.8.0"
|
21
22
|
spec.add_dependency "faraday_middleware", "~> 0.9.0"
|
22
23
|
|
metadata
CHANGED
@@ -1,125 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traitify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Prats
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: hashie
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: faraday
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
16
30
|
requirements:
|
17
|
-
- - ~>
|
31
|
+
- - "~>"
|
18
32
|
- !ruby/object:Gem::Version
|
19
33
|
version: 0.8.0
|
20
34
|
type: :runtime
|
21
35
|
prerelease: false
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
23
37
|
requirements:
|
24
|
-
- - ~>
|
38
|
+
- - "~>"
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: 0.8.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: faraday_middleware
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
|
-
- - ~>
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
47
|
version: 0.9.0
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- - ~>
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: 0.9.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- - ~>
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
61
|
version: '1.3'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- - ~>
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
68
|
version: '1.3'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - ~>
|
73
|
+
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
75
|
version: 10.1.0
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - ~>
|
80
|
+
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: 10.1.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rspec
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- - ~>
|
87
|
+
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: 2.14.0
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- - ~>
|
94
|
+
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: 2.14.0
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: pry
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
103
|
version: '0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: binding_of_caller
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
|
-
- -
|
115
|
+
- - ">="
|
102
116
|
- !ruby/object:Gem::Version
|
103
117
|
version: '0'
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
|
-
- -
|
122
|
+
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: webmock
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- - ~>
|
129
|
+
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
131
|
version: 1.13.0
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- - ~>
|
136
|
+
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
138
|
version: 1.13.0
|
125
139
|
description: Traitify Developer Gem
|
@@ -128,41 +142,35 @@ executables: []
|
|
128
142
|
extensions: []
|
129
143
|
extra_rdoc_files: []
|
130
144
|
files:
|
131
|
-
- .gitignore
|
145
|
+
- ".gitignore"
|
132
146
|
- CHANGELOG.md
|
133
147
|
- Gemfile
|
134
148
|
- Gemfile.lock
|
135
149
|
- LICENSE.txt
|
136
150
|
- README.md
|
137
151
|
- lib/traitify.rb
|
138
|
-
- lib/traitify/assessments.rb
|
139
|
-
- lib/traitify/badges.rb
|
140
152
|
- lib/traitify/client.rb
|
141
153
|
- lib/traitify/client/assessments.rb
|
154
|
+
- lib/traitify/client/decks.rb
|
142
155
|
- lib/traitify/client/results.rb
|
143
156
|
- lib/traitify/client/slides.rb
|
144
|
-
- lib/traitify/client/users.rb
|
145
157
|
- lib/traitify/configuration.rb
|
146
158
|
- lib/traitify/connection.rb
|
147
159
|
- lib/traitify/error.rb
|
148
|
-
- lib/traitify/personality_blends.rb
|
149
|
-
- lib/traitify/personality_types.rb
|
150
160
|
- lib/traitify/request.rb
|
151
|
-
- lib/traitify/results.rb
|
152
|
-
- lib/traitify/slides.rb
|
153
|
-
- lib/traitify/users.rb
|
154
161
|
- lib/traitify/version.rb
|
155
162
|
- spec/spec_helper.rb
|
156
163
|
- spec/support/mocks/assessment.json
|
164
|
+
- spec/support/mocks/decks.json
|
165
|
+
- spec/support/mocks/personality_traits.json
|
157
166
|
- spec/support/mocks/result.json
|
158
167
|
- spec/support/mocks/slide.json
|
159
168
|
- spec/support/mocks/slides.json
|
160
169
|
- spec/support/mocks/slides_complete.json
|
161
|
-
- spec/support/mocks/user.json
|
162
170
|
- spec/traitify-ruby/client/assessment_spec.rb
|
171
|
+
- spec/traitify-ruby/client/deck_spec.rb
|
163
172
|
- spec/traitify-ruby/client/result_spec.rb
|
164
173
|
- spec/traitify-ruby/client/slide_spec.rb
|
165
|
-
- spec/traitify-ruby/client/user_spec.rb
|
166
174
|
- traitify.gemspec
|
167
175
|
homepage: ''
|
168
176
|
licenses:
|
@@ -174,29 +182,31 @@ require_paths:
|
|
174
182
|
- lib
|
175
183
|
required_ruby_version: !ruby/object:Gem::Requirement
|
176
184
|
requirements:
|
177
|
-
- -
|
185
|
+
- - ">="
|
178
186
|
- !ruby/object:Gem::Version
|
179
187
|
version: '0'
|
180
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
189
|
requirements:
|
182
|
-
- -
|
190
|
+
- - ">="
|
183
191
|
- !ruby/object:Gem::Version
|
184
192
|
version: '0'
|
185
193
|
requirements: []
|
186
194
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
195
|
+
rubygems_version: 2.2.2
|
188
196
|
signing_key:
|
189
197
|
specification_version: 4
|
190
198
|
summary: Traitify Developer Gem
|
191
199
|
test_files:
|
192
200
|
- spec/spec_helper.rb
|
193
201
|
- spec/support/mocks/assessment.json
|
202
|
+
- spec/support/mocks/decks.json
|
203
|
+
- spec/support/mocks/personality_traits.json
|
194
204
|
- spec/support/mocks/result.json
|
195
205
|
- spec/support/mocks/slide.json
|
196
206
|
- spec/support/mocks/slides.json
|
197
207
|
- spec/support/mocks/slides_complete.json
|
198
|
-
- spec/support/mocks/user.json
|
199
208
|
- spec/traitify-ruby/client/assessment_spec.rb
|
209
|
+
- spec/traitify-ruby/client/deck_spec.rb
|
200
210
|
- spec/traitify-ruby/client/result_spec.rb
|
201
211
|
- spec/traitify-ruby/client/slide_spec.rb
|
202
|
-
|
212
|
+
has_rdoc:
|