openstax_exchange 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +15 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +8 -0
- data/Gemfile +4 -0
- data/MIT-LICENSE +3 -1
- data/README.md +58 -20
- data/Rakefile +5 -13
- data/exchange-client.gemspec +30 -0
- data/lib/openstax/exchange/client_instance.rb +23 -0
- data/lib/openstax/exchange/configuration.rb +12 -0
- data/lib/openstax/exchange/exceptions.rb +21 -0
- data/lib/openstax/exchange/exchange.rb +65 -0
- data/lib/openstax/exchange/fake_client/configuration.rb +13 -0
- data/lib/openstax/exchange/fake_client/fake_client.rb +71 -0
- data/lib/openstax/exchange/real_client/real_client.rb +76 -0
- data/lib/openstax/exchange/version.rb +1 -1
- data/lib/openstax_exchange.rb +8 -112
- data/spec/cassettes/OpenStax_Exchange/client_instance_configuration/can_be_configured_to_use_a_real_exchange_client.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange/internal_client_instance/_client_defaults_to_a_real_exchange_client.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange/internal_client_instance/_reset_causes_a_new_client_object_to_be_returned_by_client.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_create_identifier/success/creates_a_distinct_identifer_per_invokation.yml +146 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_create_identifier/success/creates_and_returns_a_new_identifier.yml +97 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_initialize/invalid_platform_id/raises_an_exception.yml +52 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_initialize/invalid_platform_secret/raises_an_exception.yml +52 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_initialize/success/initializes_the_authentication_token.yml +48 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/duplicate_identifer_resource_trial_triplet/raises_an_exception.yml +194 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/invalid_resource_string/raises_an_exception.yml +145 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/allows_answers_with_distinct_identifiers_to_be_saved.yml +244 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/allows_answers_with_distinct_resources_to_be_saved.yml +195 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/allows_answers_with_distinct_trials_to_be_saved.yml +195 -0
- data/spec/cassettes/OpenStax_Exchange_RealClient/behaves_like_exchange_client_api_v1/_record_multiple_choice_answer/success/creates_a_multiple_choice_answer_associated_with_the_given_identifier.yml +146 -0
- data/spec/lib/openstax/exchange/client_configuration_spec.rb +58 -0
- data/spec/lib/openstax/exchange/fake_client_v1_spec.rb +14 -0
- data/spec/lib/openstax/exchange/real_client_v1_spec.rb +9 -0
- data/spec/lib/openstax/exchange/shared_examples_for_exchange_client_v1.rb +208 -0
- data/spec/spec_helper.rb +52 -38
- metadata +97 -100
- checksums.yaml +0 -15
- data/spec/dummy/README.md +0 -1
- data/spec/dummy/Rakefile +0 -7
- data/spec/dummy/app/assets/javascripts/application.js +0 -15
- data/spec/dummy/app/assets/stylesheets/application.css +0 -13
- data/spec/dummy/app/controllers/api/dummy_controller.rb +0 -11
- data/spec/dummy/app/controllers/api/events_controller.rb +0 -7
- data/spec/dummy/app/controllers/application_controller.rb +0 -7
- data/spec/dummy/app/controllers/oauth_controller.rb +0 -8
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/config/application.rb +0 -55
- data/spec/dummy/config/boot.rb +0 -10
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -29
- data/spec/dummy/config/environments/production.rb +0 -69
- data/spec/dummy/config/environments/test.rb +0 -35
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/inflections.rb +0 -15
- data/spec/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/dummy/config/initializers/openstax_exchange.rb +0 -10
- data/spec/dummy/config/initializers/secret_token.rb +0 -7
- data/spec/dummy/config/initializers/session_store.rb +0 -8
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -5
- data/spec/dummy/config/routes.rb +0 -11
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +0 -16
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -929
- data/spec/dummy/log/test.log +0 -46753
- data/spec/dummy/public/404.html +0 -26
- data/spec/dummy/public/422.html +0 -26
- data/spec/dummy/public/500.html +0 -25
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +0 -6
- data/spec/lib/openstax_exchange_spec.rb +0 -23
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://999:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 401
|
19
|
+
message: Unauthorized
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Www-Authenticate:
|
34
|
+
- Bearer realm="Doorkeeper", error="invalid_client", error_description="Client
|
35
|
+
authentication failed due to unknown client, no client authentication included,
|
36
|
+
or unsupported authentication method."
|
37
|
+
X-Request-Id:
|
38
|
+
- 440a7134-78d2-4737-9895-695682901764
|
39
|
+
X-Runtime:
|
40
|
+
- '0.010947'
|
41
|
+
Connection:
|
42
|
+
- close
|
43
|
+
Server:
|
44
|
+
- thin
|
45
|
+
body:
|
46
|
+
encoding: US-ASCII
|
47
|
+
string: ! '{"error":"invalid_client","error_description":"Client authentication
|
48
|
+
failed due to unknown client, no client authentication included, or unsupported
|
49
|
+
authentication method."}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
52
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:not_the_secret@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 401
|
19
|
+
message: Unauthorized
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Www-Authenticate:
|
34
|
+
- Bearer realm="Doorkeeper", error="invalid_client", error_description="Client
|
35
|
+
authentication failed due to unknown client, no client authentication included,
|
36
|
+
or unsupported authentication method."
|
37
|
+
X-Request-Id:
|
38
|
+
- 95480e7c-febf-48dd-8a52-1a53a634f891
|
39
|
+
X-Runtime:
|
40
|
+
- '0.010191'
|
41
|
+
Connection:
|
42
|
+
- close
|
43
|
+
Server:
|
44
|
+
- thin
|
45
|
+
body:
|
46
|
+
encoding: US-ASCII
|
47
|
+
string: ! '{"error":"invalid_client","error_description":"Client authentication
|
48
|
+
failed due to unknown client, no client authentication included, or unsupported
|
49
|
+
authentication method."}'
|
50
|
+
http_version:
|
51
|
+
recorded_at: Mon, 12 Jan 2015 21:08:52 GMT
|
52
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"90694a3f6fa5e971cefcaa0cb1eb1d96"
|
35
|
+
X-Request-Id:
|
36
|
+
- 7248aa8d-32a9-44cc-a69e-fb56c7c18255
|
37
|
+
X-Runtime:
|
38
|
+
- '0.014787'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ! '{"access_token":"b65af1325000f9e1bd164a24c21d021b0716b487ff3a98dde773cdc91a9e13a8","token_type":"bearer"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 12 Jan 2015 21:08:51 GMT
|
48
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,194 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"a9b0db9b60d09f7ce86486bddc6bd620"
|
35
|
+
X-Request-Id:
|
36
|
+
- b62de81c-8bd7-4548-b970-555e429e996e
|
37
|
+
X-Runtime:
|
38
|
+
- '0.015645'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ! '{"access_token":"c547f9ee886dcae47e755cead09009b4ff3d1bbd88db7a4fbe39207ab35c794d","token_type":"bearer"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
48
|
+
- request:
|
49
|
+
method: post
|
50
|
+
uri: http://localhost:3003/api/identifiers
|
51
|
+
body:
|
52
|
+
encoding: US-ASCII
|
53
|
+
string: ''
|
54
|
+
headers:
|
55
|
+
User-Agent:
|
56
|
+
- Faraday v0.9.0
|
57
|
+
Accept:
|
58
|
+
- application/vnd.exchange.openstax.v1
|
59
|
+
Authorization:
|
60
|
+
- Bearer c547f9ee886dcae47e755cead09009b4ff3d1bbd88db7a4fbe39207ab35c794d
|
61
|
+
Content-Length:
|
62
|
+
- '0'
|
63
|
+
response:
|
64
|
+
status:
|
65
|
+
code: 201
|
66
|
+
message: Created
|
67
|
+
headers:
|
68
|
+
X-Frame-Options:
|
69
|
+
- SAMEORIGIN
|
70
|
+
X-Xss-Protection:
|
71
|
+
- 1; mode=block
|
72
|
+
X-Content-Type-Options:
|
73
|
+
- nosniff
|
74
|
+
Content-Type:
|
75
|
+
- application/json; charset=utf-8
|
76
|
+
Etag:
|
77
|
+
- W/"1e022fc97eee729685cc737484251224"
|
78
|
+
Cache-Control:
|
79
|
+
- max-age=0, private, must-revalidate
|
80
|
+
Set-Cookie:
|
81
|
+
- _exercises_session=WU1KU0h4VjlkaUMzdU01M1pwME5pLzVROG1QaHFGbnR0bzlKVXp4aE5HNm5wOG1oQW83QVdZZm1lUS9YT0JOUDVJbGFrMWxlakdTc243Tk4vdHBSL2c9PS0teW8xOVhVYTE0TTlETzdCcWhpek1RZz09--b92be7656418e43b4f27c7e83f4f5cac1b955a64;
|
82
|
+
path=/; HttpOnly
|
83
|
+
- request_method=POST; path=/
|
84
|
+
X-Request-Id:
|
85
|
+
- 28d45194-711a-413d-a47a-21bbc83aa72b
|
86
|
+
X-Runtime:
|
87
|
+
- '0.040288'
|
88
|
+
Connection:
|
89
|
+
- close
|
90
|
+
Server:
|
91
|
+
- thin
|
92
|
+
body:
|
93
|
+
encoding: US-ASCII
|
94
|
+
string: ! '{"identifier":"34cdf6b6a4b45643b31b5cd63212e95cb55accb36080015048de5e7394f74841"}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
97
|
+
- request:
|
98
|
+
method: post
|
99
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
100
|
+
body:
|
101
|
+
encoding: UTF-8
|
102
|
+
string: ! '{"identifier":"34cdf6b6a4b45643b31b5cd63212e95cb55accb36080015048de5e7394f74841","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","answer":"answer_string"}'
|
103
|
+
headers:
|
104
|
+
User-Agent:
|
105
|
+
- Faraday v0.9.0
|
106
|
+
Accept:
|
107
|
+
- application/vnd.exchange.openstax.v1
|
108
|
+
Authorization:
|
109
|
+
- Bearer c547f9ee886dcae47e755cead09009b4ff3d1bbd88db7a4fbe39207ab35c794d
|
110
|
+
Content-Type:
|
111
|
+
- application/x-www-form-urlencoded
|
112
|
+
response:
|
113
|
+
status:
|
114
|
+
code: 201
|
115
|
+
message: Created
|
116
|
+
headers:
|
117
|
+
X-Frame-Options:
|
118
|
+
- SAMEORIGIN
|
119
|
+
X-Xss-Protection:
|
120
|
+
- 1; mode=block
|
121
|
+
X-Content-Type-Options:
|
122
|
+
- nosniff
|
123
|
+
Content-Type:
|
124
|
+
- application/json; charset=utf-8
|
125
|
+
Etag:
|
126
|
+
- W/"a8ac499a2a9e9dbf8c7c3083274494d7"
|
127
|
+
Cache-Control:
|
128
|
+
- max-age=0, private, must-revalidate
|
129
|
+
Set-Cookie:
|
130
|
+
- _exercises_session=YzVmZC9xY01WMnV5R0NTN2VyVXRJN1o3MkFibERUbkdGMitTK2VoNC9qeDVqSTJUY3JIdjRJUk9SM1gzdFZoalcyb3I0TTZVWWJ4SmhnUHBxWkxQS2c9PS0ta0NMM1ZpaDg4aWVTalpIMjRYcFdWUT09--fe66330b75140d7a608e3a93e92ed346ea94a214;
|
131
|
+
path=/; HttpOnly
|
132
|
+
- request_method=POST; path=/
|
133
|
+
X-Request-Id:
|
134
|
+
- 81931d67-6105-4d89-bdfe-73684beef41f
|
135
|
+
X-Runtime:
|
136
|
+
- '0.080417'
|
137
|
+
Connection:
|
138
|
+
- close
|
139
|
+
Server:
|
140
|
+
- thin
|
141
|
+
body:
|
142
|
+
encoding: US-ASCII
|
143
|
+
string: ! '{"identifier":"34cdf6b6a4b45643b31b5cd63212e95cb55accb36080015048de5e7394f74841","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","created_at":"2015-01-12T21:08:53.550Z","answer_type":"multiple-choice","answer":"answer_string"}'
|
144
|
+
http_version:
|
145
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
146
|
+
- request:
|
147
|
+
method: post
|
148
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
149
|
+
body:
|
150
|
+
encoding: UTF-8
|
151
|
+
string: ! '{"identifier":"34cdf6b6a4b45643b31b5cd63212e95cb55accb36080015048de5e7394f74841","resource":"http://exercises.openstax.org/exercises/1234","trial":"1","answer":"answer_string"}'
|
152
|
+
headers:
|
153
|
+
User-Agent:
|
154
|
+
- Faraday v0.9.0
|
155
|
+
Accept:
|
156
|
+
- application/vnd.exchange.openstax.v1
|
157
|
+
Authorization:
|
158
|
+
- Bearer c547f9ee886dcae47e755cead09009b4ff3d1bbd88db7a4fbe39207ab35c794d
|
159
|
+
Content-Type:
|
160
|
+
- application/x-www-form-urlencoded
|
161
|
+
response:
|
162
|
+
status:
|
163
|
+
code: 422
|
164
|
+
message: Unprocessable Entity
|
165
|
+
headers:
|
166
|
+
X-Frame-Options:
|
167
|
+
- SAMEORIGIN
|
168
|
+
X-Xss-Protection:
|
169
|
+
- 1; mode=block
|
170
|
+
X-Content-Type-Options:
|
171
|
+
- nosniff
|
172
|
+
Content-Type:
|
173
|
+
- application/json; charset=utf-8
|
174
|
+
Cache-Control:
|
175
|
+
- no-cache
|
176
|
+
Set-Cookie:
|
177
|
+
- _exercises_session=MmlzQS9IZVEzNW1LN1pOTzNsSXFMVkIrVnRLaEJzaTRsNjl6MEI1ZmxWQXlkWnBBOWsvTUxGMjV6U2RLMFlPb2xlMnM2S3FKTjkyb0hJNEtaUTFUY3c9PS0tTFdFVEdRbUEweEluZWU1MjZEYkhqQT09--d606058ac3ab90d11d80a174fe0ff3700c986759;
|
178
|
+
path=/; HttpOnly
|
179
|
+
- request_method=POST; path=/
|
180
|
+
X-Request-Id:
|
181
|
+
- 91cad2b8-87ce-4063-8b1a-a62d3f28766e
|
182
|
+
X-Runtime:
|
183
|
+
- '0.117100'
|
184
|
+
Connection:
|
185
|
+
- close
|
186
|
+
Server:
|
187
|
+
- thin
|
188
|
+
body:
|
189
|
+
encoding: US-ASCII
|
190
|
+
string: ! '[{"code":"taken","data":{"model":{"id":null,"identifier_id":904,"resource_id":5,"trial":"1","due_at":null,"created_at":null,"updated_at":null},"attribute":"trial"},"kind":"activerecord","message":"has
|
191
|
+
already been taken","offending_inputs":"trial"}]'
|
192
|
+
http_version:
|
193
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
194
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,145 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://123:abc@localhost:3003/oauth/token
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: grant_type=client_credentials
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.9.0
|
12
|
+
Content-Type:
|
13
|
+
- application/x-www-form-urlencoded
|
14
|
+
Accept:
|
15
|
+
- ! '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
X-Frame-Options:
|
22
|
+
- SAMEORIGIN
|
23
|
+
X-Xss-Protection:
|
24
|
+
- 1; mode=block
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Cache-Control:
|
28
|
+
- no-store
|
29
|
+
Pragma:
|
30
|
+
- no-cache
|
31
|
+
Content-Type:
|
32
|
+
- application/json; charset=utf-8
|
33
|
+
Etag:
|
34
|
+
- W/"e82148ecc7398094123885adfdba75c5"
|
35
|
+
X-Request-Id:
|
36
|
+
- 6b1be560-90d3-43fb-bd3f-d798b7a8e167
|
37
|
+
X-Runtime:
|
38
|
+
- '0.018834'
|
39
|
+
Connection:
|
40
|
+
- close
|
41
|
+
Server:
|
42
|
+
- thin
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ! '{"access_token":"e244b488c23861c57ced25c8dc53fa6335243fafc4f09df2e84d27a4256142d8","token_type":"bearer"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
48
|
+
- request:
|
49
|
+
method: post
|
50
|
+
uri: http://localhost:3003/api/identifiers
|
51
|
+
body:
|
52
|
+
encoding: US-ASCII
|
53
|
+
string: ''
|
54
|
+
headers:
|
55
|
+
User-Agent:
|
56
|
+
- Faraday v0.9.0
|
57
|
+
Accept:
|
58
|
+
- application/vnd.exchange.openstax.v1
|
59
|
+
Authorization:
|
60
|
+
- Bearer e244b488c23861c57ced25c8dc53fa6335243fafc4f09df2e84d27a4256142d8
|
61
|
+
Content-Length:
|
62
|
+
- '0'
|
63
|
+
response:
|
64
|
+
status:
|
65
|
+
code: 201
|
66
|
+
message: Created
|
67
|
+
headers:
|
68
|
+
X-Frame-Options:
|
69
|
+
- SAMEORIGIN
|
70
|
+
X-Xss-Protection:
|
71
|
+
- 1; mode=block
|
72
|
+
X-Content-Type-Options:
|
73
|
+
- nosniff
|
74
|
+
Content-Type:
|
75
|
+
- application/json; charset=utf-8
|
76
|
+
Etag:
|
77
|
+
- W/"f1c4f3ca5efef827df31d6a1a9b9b34b"
|
78
|
+
Cache-Control:
|
79
|
+
- max-age=0, private, must-revalidate
|
80
|
+
Set-Cookie:
|
81
|
+
- _exercises_session=WGZYRWhJSVNaY3JySjVGdlMwQmtqQmRVbWZWRmNrdDNJSzNTQ1h0Q1BqNmJGU2xzdFQrbCtHQnBjVUNYbWtMRXRncHhYLzNHR241cjBRTUVDdWJLMUE9PS0tNm50UlRhVmpBeWF1VGJzZGFIdU9DQT09--2c8ce07078730b3eadc71d842efc29034f100b80;
|
82
|
+
path=/; HttpOnly
|
83
|
+
- request_method=POST; path=/
|
84
|
+
X-Request-Id:
|
85
|
+
- f1b85a63-4661-4415-9682-223154ee95fe
|
86
|
+
X-Runtime:
|
87
|
+
- '0.045214'
|
88
|
+
Connection:
|
89
|
+
- close
|
90
|
+
Server:
|
91
|
+
- thin
|
92
|
+
body:
|
93
|
+
encoding: US-ASCII
|
94
|
+
string: ! '{"identifier":"649c2d0e63a37048191cad69cee18f795873ef19b222aa261d47c5711ece5ad8"}'
|
95
|
+
http_version:
|
96
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
97
|
+
- request:
|
98
|
+
method: post
|
99
|
+
uri: http://localhost:3003/api/events/platforms/multiple_choices
|
100
|
+
body:
|
101
|
+
encoding: UTF-8
|
102
|
+
string: ! '{"identifier":"649c2d0e63a37048191cad69cee18f795873ef19b222aa261d47c5711ece5ad8","resource":"http://example.com/exercises/1234","trial":"1","answer":"answer_string"}'
|
103
|
+
headers:
|
104
|
+
User-Agent:
|
105
|
+
- Faraday v0.9.0
|
106
|
+
Accept:
|
107
|
+
- application/vnd.exchange.openstax.v1
|
108
|
+
Authorization:
|
109
|
+
- Bearer e244b488c23861c57ced25c8dc53fa6335243fafc4f09df2e84d27a4256142d8
|
110
|
+
Content-Type:
|
111
|
+
- application/x-www-form-urlencoded
|
112
|
+
response:
|
113
|
+
status:
|
114
|
+
code: 422
|
115
|
+
message: Unprocessable Entity
|
116
|
+
headers:
|
117
|
+
X-Frame-Options:
|
118
|
+
- SAMEORIGIN
|
119
|
+
X-Xss-Protection:
|
120
|
+
- 1; mode=block
|
121
|
+
X-Content-Type-Options:
|
122
|
+
- nosniff
|
123
|
+
Content-Type:
|
124
|
+
- application/json; charset=utf-8
|
125
|
+
Cache-Control:
|
126
|
+
- no-cache
|
127
|
+
Set-Cookie:
|
128
|
+
- _exercises_session=cjVRUHV3OEc0L00rWEhQdGl4VDVONkhSbC9Wd0xyelNGVHFLRkxVUjE4d0xKYWdCZnBObTNkRVlRajhNbWYyNDcwK01razNlbHN5OWZVYVlUS2FoekE9PS0tbDh4N0VWTDRUdXhiRnVCeDd2NUlNdz09--0a57cbadaa3ebf05b46c4141001fe664f1ca05ca;
|
129
|
+
path=/; HttpOnly
|
130
|
+
- request_method=POST; path=/
|
131
|
+
X-Request-Id:
|
132
|
+
- cf5ec792-42bc-44b4-9716-ff31d9c9d645
|
133
|
+
X-Runtime:
|
134
|
+
- '0.037583'
|
135
|
+
Connection:
|
136
|
+
- close
|
137
|
+
Server:
|
138
|
+
- thin
|
139
|
+
body:
|
140
|
+
encoding: US-ASCII
|
141
|
+
string: ! '[{"code":"blank","data":{"model":{"id":null,"identifier_id":905,"resource_id":null,"trial":"1","due_at":null,"created_at":null,"updated_at":null},"attribute":"resource"},"kind":"activerecord","message":"can''t
|
142
|
+
be blank","offending_inputs":"resource"}]'
|
143
|
+
http_version:
|
144
|
+
recorded_at: Mon, 12 Jan 2015 21:08:53 GMT
|
145
|
+
recorded_with: VCR 2.9.3
|