edools-api 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/edools-api.gemspec +57 -11
- data/lib/edools.rb +2 -1
- data/lib/edools/base.rb +25 -0
- data/lib/edools/config.rb +2 -2
- data/lib/edools/core.rb +6 -1
- data/lib/edools/core/base.rb +3 -12
- data/lib/edools/core/course.rb +10 -0
- data/lib/edools/core/course_content.rb +15 -0
- data/lib/edools/core/course_module.rb +15 -0
- data/lib/edools/core/enrollment.rb +2 -2
- data/lib/edools/core/lesson.rb +10 -0
- data/lib/edools/core/media.rb +10 -0
- data/lib/edools/core/organization.rb +2 -2
- data/lib/edools/core/path.rb +10 -0
- data/lib/edools/core/registration.rb +2 -2
- data/lib/edools/core/school.rb +2 -2
- data/lib/edools/core/school_product.rb +2 -2
- data/lib/edools/core/session.rb +1 -1
- data/lib/edools/core/student.rb +2 -2
- data/lib/edools/ecommerce.rb +2 -0
- data/lib/edools/ecommerce/base.rb +8 -0
- data/lib/edools/ecommerce/product.rb +21 -0
- data/lib/edools/initialization.rb +4 -1
- data/lib/edools/paginated_collection.rb +37 -0
- data/spec/edools/core/course_content_spec.rb +35 -0
- data/spec/edools/core/course_module_spec.rb +35 -0
- data/spec/edools/core/course_spec.rb +36 -0
- data/spec/edools/core/enrollment_spec.rb +1 -3
- data/spec/edools/core/lesson_spec.rb +39 -0
- data/spec/edools/core/media_spec.rb +40 -0
- data/spec/edools/core/path_spec.rb +36 -0
- data/spec/edools/core/school_product_spec.rb +10 -6
- data/spec/edools/ecommerce/base_spec.rb +9 -0
- data/spec/edools/ecommerce/product_spec.rb +38 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Course/create_the_course.yml +66 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Course/destroy_the_course.yml +114 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Course/finds_all_course.yml +146 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Course/finds_the_course.yml +62 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Course/update_the_course.yml +118 -0
- data/spec/fixtures/vcr_cassettes/{Edools_Core_SchoolClass/create_the_school_class.yml → Edools_Core_CourseContent/create_the_course_content.yml} +11 -11
- data/spec/fixtures/vcr_cassettes/{Edools_Core_SchoolClass/destroy_the_school_class.yml → Edools_Core_CourseContent/destroy_the_course_content.yml} +14 -14
- data/spec/fixtures/vcr_cassettes/Edools_Core_CourseContent/finds_all_course_content.yml +64 -0
- data/spec/fixtures/vcr_cassettes/{Edools_Core_SchoolClass/finds_the_school_class.yml → Edools_Core_CourseContent/finds_the_course_content.yml} +9 -9
- data/spec/fixtures/vcr_cassettes/{Edools_Core_SchoolClass/update_the_school_class.yml → Edools_Core_CourseContent/update_the_course_content.yml} +17 -17
- data/spec/fixtures/vcr_cassettes/Edools_Core_CourseModule/create_the_course_module.yml +66 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_CourseModule/destroy_the_course_module.yml +114 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_CourseModule/finds_all_course_module.yml +78 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_CourseModule/finds_the_course_module.yml +67 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_CourseModule/update_the_course_module.yml +123 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Lesson/create_the_lesson.yml +66 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Lesson/destroy_the_lesson.yml +115 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Lesson/finds_all_lesson.yml +154 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Lesson/finds_the_lesson.yml +62 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Lesson/update_the_lesson.yml +118 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Media/create_the_media.yml +68 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Media/destroy_the_media.yml +116 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Media/finds_all_media.yml +212 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Media/finds_the_media.yml +63 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Media/update_the_media.yml +120 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Path/create_the_path.yml +66 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Path/destroy_the_path.yml +114 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_Path/finds_all_path.yml +78 -0
- data/spec/fixtures/vcr_cassettes/{Edools_Core_SchoolClass/finds_all_school_class.yml → Edools_Core_Path/finds_the_path.yml} +11 -10
- data/spec/fixtures/vcr_cassettes/Edools_Core_Path/update_the_path.yml +117 -0
- data/spec/fixtures/vcr_cassettes/Edools_Core_SchoolProduct/create_the_school_product.yml +11 -11
- data/spec/fixtures/vcr_cassettes/Edools_Core_SchoolProduct/destroy_the_school_product.yml +17 -16
- data/spec/fixtures/vcr_cassettes/Edools_Core_SchoolProduct/finds_all_school_product.yml +173 -125
- data/spec/fixtures/vcr_cassettes/Edools_Core_SchoolProduct/finds_the_school_product.yml +10 -10
- data/spec/fixtures/vcr_cassettes/Edools_Core_SchoolProduct/update_the_school_product.yml +18 -18
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/create_the_product.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/destroy_the_product.yml +114 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/finds_all_product.yml +179 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/finds_the_product.yml +62 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/update_the_product.yml +117 -0
- metadata +56 -10
- data/lib/edools/core/paginated_collection.rb +0 -30
- data/lib/edools/core/school_class.rb +0 -14
- data/spec/edools/core/school_class_spec.rb +0 -35
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'active_resource'
|
2
|
+
|
3
|
+
module Edools
|
4
|
+
class PaginatedCollection < ActiveResource::Collection
|
5
|
+
|
6
|
+
# Our custom array to handle pagination methods
|
7
|
+
attr_accessor :total_pages, :per_page, :total_count, :current_page
|
8
|
+
|
9
|
+
# The initialize method will receive the ActiveResource parsed result
|
10
|
+
# and set @elements.
|
11
|
+
def initialize(parsed = {})
|
12
|
+
@elements = parsed[resource_key(parsed.keys)]
|
13
|
+
@total_pages = parsed["total_pages"]
|
14
|
+
@per_page = parsed["per_page"]
|
15
|
+
@total_count = parsed["total_count"]
|
16
|
+
@current_page = parsed["current_page"]
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def resource_key(keys)
|
22
|
+
(Edools.api_objects
|
23
|
+
.collect { |klass| split_class_name_to_key_match(klass) }.flatten & keys).first
|
24
|
+
end
|
25
|
+
|
26
|
+
def split_class_name_to_key_match(klass)
|
27
|
+
resource_key = klass.name.split("::").last.underscore.pluralize
|
28
|
+
|
29
|
+
if resource_key.include?('_')
|
30
|
+
[resource_key, resource_key.gsub('_')]
|
31
|
+
else
|
32
|
+
resource_key
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Core::CourseContent, :vcr do
|
4
|
+
it 'finds all course_content' do
|
5
|
+
course_contents = Edools::Core::CourseContent.all(params: { course_module_id: 11329 })
|
6
|
+
|
7
|
+
expect(course_contents.count).to eq 3
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'finds the course_content' do
|
11
|
+
course_content = Edools::Core::CourseContent.find(52239)
|
12
|
+
|
13
|
+
expect(course_content.id).to eq 52239
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'update the course_content' do
|
17
|
+
course_content = Edools::Core::CourseContent.find(52239)
|
18
|
+
course_content.description = 'Edools API Test'
|
19
|
+
|
20
|
+
expect(course_content.save).to eq true
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'create the course_content' do
|
24
|
+
course_content = Edools::Core::CourseContent.new()
|
25
|
+
course_content.prefix_options[:course_module_id] = 11329
|
26
|
+
course_content.name = "Edools API Test"
|
27
|
+
|
28
|
+
expect(course_content.save).to eq true
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'destroy the course_content' do
|
32
|
+
course_content = Edools::Core::CourseContent.find(52239)
|
33
|
+
expect(course_content.destroy).to be_truthy
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Core::CourseModule, :vcr do
|
4
|
+
it 'finds all course_module' do
|
5
|
+
course_modules = Edools::Core::CourseModule.all(params: { course_id: 1566 })
|
6
|
+
|
7
|
+
expect(course_modules.count).to eq 3
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'finds the course_module' do
|
11
|
+
course_module = Edools::Core::CourseModule.find(11329)
|
12
|
+
|
13
|
+
expect(course_module.id).to eq 11329
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'update the course_module' do
|
17
|
+
course_module = Edools::Core::CourseModule.find(11329)
|
18
|
+
course_module.description = 'Edools API TEST'
|
19
|
+
|
20
|
+
expect(course_module.save).to eq true
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'create the course_module' do
|
24
|
+
course_module = Edools::Core::CourseModule.new()
|
25
|
+
course_module.prefix_options[:course_id] = 1566
|
26
|
+
course_module.name = "Teste"
|
27
|
+
|
28
|
+
expect(course_module.save).to eq true
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'destroy the course_module' do
|
32
|
+
course_module = Edools::Core::CourseModule.find(11976)
|
33
|
+
expect(course_module.destroy).to be_truthy
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Core::Course, :vcr do
|
4
|
+
it 'finds the course' do
|
5
|
+
course = Edools::Core::Course.find(12473)
|
6
|
+
|
7
|
+
expect(course.id).to eq 12473
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'finds all course' do
|
11
|
+
courses = Edools::Core::Course.all
|
12
|
+
expect(courses.count).to eq 10
|
13
|
+
expect(courses.per_page). to eq 10
|
14
|
+
expect(courses.current_page). to eq 1
|
15
|
+
expect(courses.total_count). to eq 49
|
16
|
+
expect(courses.total_pages). to eq 5
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'update the course' do
|
20
|
+
course = Edools::Core::Course.find(12473)
|
21
|
+
course.description = 'Edools API test'
|
22
|
+
|
23
|
+
expect(course.save).to be_truthy
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'create the course' do
|
27
|
+
course = Edools::Core::Course.new(name: 'Edools API Test')
|
28
|
+
|
29
|
+
expect(course.save).to be_truthy
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'destroy the course' do
|
33
|
+
course = Edools::Core::Course.find(12473)
|
34
|
+
expect(course.destroy).to be_truthy
|
35
|
+
end
|
36
|
+
end
|
@@ -22,12 +22,10 @@ describe Edools::Core::Enrollment, :vcr do
|
|
22
22
|
|
23
23
|
it 'create the enrollment' do
|
24
24
|
student = Edools::Core::Student.find(:first)
|
25
|
-
school_class = Edools::Core::SchoolClass.find(:first, params: { school_product_id: 156 })
|
26
25
|
|
27
|
-
enrollment = Edools::Core::Enrollment.new
|
26
|
+
enrollment = Edools::Core::Enrollment.new
|
28
27
|
|
29
28
|
enrollment.registration_id = student.registrations.first.id
|
30
|
-
enrollment.school_class_id = school_class.id
|
31
29
|
enrollment.unlimited = true
|
32
30
|
enrollment.status = 'active'
|
33
31
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Core::Lesson, :vcr do
|
4
|
+
it 'finds all lesson' do
|
5
|
+
lessons = Edools::Core::Lesson.all
|
6
|
+
|
7
|
+
expect(lessons.count).to eq 10
|
8
|
+
expect(lessons.per_page). to eq 10
|
9
|
+
expect(lessons.current_page). to eq 1
|
10
|
+
expect(lessons.total_count). to eq 381
|
11
|
+
expect(lessons.total_pages). to eq 39
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'finds the lesson' do
|
15
|
+
lesson = Edools::Core::Lesson.find(52232)
|
16
|
+
|
17
|
+
expect(lesson.id).to eq 52232
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'update the lesson' do
|
21
|
+
lesson = Edools::Core::Lesson.find(52232)
|
22
|
+
lesson.description = 'Edools API Test'
|
23
|
+
|
24
|
+
expect(lesson.save).to eq true
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'create the lesson' do
|
28
|
+
lesson = Edools::Core::Lesson.new()
|
29
|
+
lesson.title = "Edools API Test"
|
30
|
+
lesson.type = 'ContentLesson'
|
31
|
+
|
32
|
+
expect(lesson.save).to eq true
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'destroy the lesson' do
|
36
|
+
lesson = Edools::Core::Lesson.find(52232)
|
37
|
+
expect(lesson.destroy).to be_truthy
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Core::Media, :vcr do
|
4
|
+
it 'finds all media' do
|
5
|
+
all_media = Edools::Core::Media.all
|
6
|
+
|
7
|
+
expect(all_media.count).to eq 10
|
8
|
+
expect(all_media.per_page). to eq 10
|
9
|
+
expect(all_media.current_page). to eq 1
|
10
|
+
expect(all_media.total_count). to eq 639
|
11
|
+
expect(all_media.total_pages). to eq 64
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'finds the media' do
|
15
|
+
media = Edools::Core::Media.find(54344)
|
16
|
+
|
17
|
+
expect(media.id).to eq 54344
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'update the media' do
|
21
|
+
media = Edools::Core::Media.find(54344)
|
22
|
+
media.description = 'Edools API Test'
|
23
|
+
|
24
|
+
expect(media.save).to eq true
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'create the media' do
|
28
|
+
media = Edools::Core::Media.new()
|
29
|
+
media.title = "Edools API Test"
|
30
|
+
media.type = 'Text'
|
31
|
+
media.text = 'Edools API Test Text'
|
32
|
+
|
33
|
+
expect(media.save).to eq true
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'destroy the media' do
|
37
|
+
media = Edools::Core::Media.find(54344)
|
38
|
+
expect(media.destroy).to be_truthy
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Core::Path, :vcr do
|
4
|
+
it 'finds the path' do
|
5
|
+
path = Edools::Core::Path.find(1008)
|
6
|
+
|
7
|
+
expect(path.id).to eq 1008
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'finds all path' do
|
11
|
+
paths = Edools::Core::Path.all
|
12
|
+
expect(paths.count).to eq 10
|
13
|
+
expect(paths.per_page). to eq 10
|
14
|
+
expect(paths.current_page). to eq 1
|
15
|
+
expect(paths.total_count). to eq 20
|
16
|
+
expect(paths.total_pages). to eq 2
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'update the path' do
|
20
|
+
path = Edools::Core::Path.find(1008)
|
21
|
+
path.description = 'Edools API test'
|
22
|
+
|
23
|
+
expect(path.save).to be_truthy
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'create the path' do
|
27
|
+
path = Edools::Core::Path.new(name: 'Edools API Test')
|
28
|
+
|
29
|
+
expect(path.save).to be_truthy
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'destroy the path' do
|
33
|
+
path = Edools::Core::Path.find(1750)
|
34
|
+
expect(path.destroy).to be_truthy
|
35
|
+
end
|
36
|
+
end
|
@@ -4,18 +4,22 @@ describe Edools::Core::SchoolProduct, :vcr do
|
|
4
4
|
it 'finds all school product' do
|
5
5
|
school_products = Edools::Core::SchoolProduct.all(params: { school_id: 224 })
|
6
6
|
|
7
|
-
expect(school_products.count).to eq
|
7
|
+
expect(school_products.count).to eq 10
|
8
|
+
expect(school_products.per_page). to eq 10
|
9
|
+
expect(school_products.current_page). to eq 1
|
10
|
+
expect(school_products.total_count). to eq 73
|
11
|
+
expect(school_products.total_pages). to eq 8
|
8
12
|
end
|
9
13
|
|
10
14
|
it 'finds the school product' do
|
11
|
-
school_product = Edools::Core::SchoolProduct.find(
|
15
|
+
school_product = Edools::Core::SchoolProduct.find(2718)
|
12
16
|
|
13
|
-
expect(school_product.id).to eq
|
17
|
+
expect(school_product.id).to eq 2718
|
14
18
|
end
|
15
19
|
|
16
20
|
it 'update the school product' do
|
17
|
-
school_product = Edools::Core::SchoolProduct.find(
|
18
|
-
school_product.description = "
|
21
|
+
school_product = Edools::Core::SchoolProduct.find(2718)
|
22
|
+
school_product.description = "Edools API Test"
|
19
23
|
|
20
24
|
expect(school_product.save).to eq true
|
21
25
|
end
|
@@ -29,7 +33,7 @@ describe Edools::Core::SchoolProduct, :vcr do
|
|
29
33
|
end
|
30
34
|
|
31
35
|
it 'destroy the school product' do
|
32
|
-
school_product = Edools::Core::SchoolProduct.find(
|
36
|
+
school_product = Edools::Core::SchoolProduct.find(2718)
|
33
37
|
expect(school_product.destroy.code).to eq '204'
|
34
38
|
end
|
35
39
|
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Ecommerce::Base do
|
4
|
+
describe 'location' do
|
5
|
+
it 'sets site to edools ecommerce api url' do
|
6
|
+
expect(Edools::Ecommerce::Base.site.to_s).to eq 'https://ecommerce.edools.com'
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Ecommerce::Product, :vcr do
|
4
|
+
it 'finds all product' do
|
5
|
+
products = Edools::Ecommerce::Product.all(params: { school_id: 224 })
|
6
|
+
|
7
|
+
expect(products.count).to eq 10
|
8
|
+
expect(products.per_page). to eq 10
|
9
|
+
expect(products.current_page). to eq 1
|
10
|
+
expect(products.total_count). to eq 109
|
11
|
+
expect(products.total_pages). to eq 11
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'finds the product' do
|
15
|
+
product = Edools::Ecommerce::Product.find(123)
|
16
|
+
|
17
|
+
expect(product.id).to eq 2671
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'update the product' do
|
21
|
+
product = Edools::Ecommerce::Product.find(123)
|
22
|
+
product.name = "Edools API Test UPDATED"
|
23
|
+
|
24
|
+
expect(product.save).to eq true
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'create the product' do
|
28
|
+
product = Edools::Ecommerce::Product.new(name: 'Edools API Test', guid: '123', price: 0)
|
29
|
+
product.prefix_options[:school_id] = 224
|
30
|
+
|
31
|
+
expect(product.save).to eq true
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'destroy the product' do
|
35
|
+
product = Edools::Ecommerce::Product.find(123)
|
36
|
+
expect(product.destroy.code).to eq '204'
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://core.edools.com/courses.json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"course":{"name":"Edools API Test"}}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept:
|
15
|
+
- application/vnd.edools.core.v1+json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Cache-Control:
|
26
|
+
- max-age=0, private, must-revalidate
|
27
|
+
Content-Security-Policy-Report-Only:
|
28
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
29
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
30
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
31
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
32
|
+
Content-Type:
|
33
|
+
- application/vnd.edools.core.v1+json; charset=utf-8
|
34
|
+
Date:
|
35
|
+
- Mon, 06 Jul 2015 18:40:47 GMT
|
36
|
+
Etag:
|
37
|
+
- '"05afd31daad949eabd999d7e754075da"'
|
38
|
+
Location:
|
39
|
+
- https://core.edools.com/courses/12473
|
40
|
+
Server:
|
41
|
+
- nginx/1.4.7
|
42
|
+
Status:
|
43
|
+
- 201 Created
|
44
|
+
Strict-Transport-Security:
|
45
|
+
- max-age=631152000; includeSubdomains
|
46
|
+
X-Content-Type-Options:
|
47
|
+
- nosniff
|
48
|
+
X-Frame-Options:
|
49
|
+
- DENY
|
50
|
+
X-Request-Id:
|
51
|
+
- ec4f7799-873a-459a-87e5-a64ab64fa1d0
|
52
|
+
X-Runtime:
|
53
|
+
- '0.143671'
|
54
|
+
X-Xss-Protection:
|
55
|
+
- 1; mode=block
|
56
|
+
Content-Length:
|
57
|
+
- '295'
|
58
|
+
Connection:
|
59
|
+
- keep-alive
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"id":12473,"name":"Edools API Test","description":null,"image_url":null,"created_at":"2015-07-06
|
63
|
+
18:40:47 UTC","updated_at":"2015-07-06 18:40:47 UTC","duration":null,"path_ids":[],"forum_section_ids":[],"library_resource":{"id":121410,"school_products":[],"library":{"id":2},"library_tags":[]}}'
|
64
|
+
http_version:
|
65
|
+
recorded_at: Mon, 06 Jul 2015 18:40:47 GMT
|
66
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,114 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://core.edools.com/courses/12473.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/vnd.edools.core.v1+json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=0, private, must-revalidate
|
25
|
+
Content-Security-Policy-Report-Only:
|
26
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
27
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
28
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
29
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
30
|
+
Content-Type:
|
31
|
+
- application/vnd.edools.core.v1+json; charset=utf-8
|
32
|
+
Date:
|
33
|
+
- Mon, 06 Jul 2015 18:42:56 GMT
|
34
|
+
Etag:
|
35
|
+
- '"d46b4517d247df7aa7e2c4b7514d6fb0"'
|
36
|
+
Server:
|
37
|
+
- nginx/1.4.7
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=631152000; includeSubdomains
|
42
|
+
X-Content-Type-Options:
|
43
|
+
- nosniff
|
44
|
+
X-Frame-Options:
|
45
|
+
- DENY
|
46
|
+
X-Request-Id:
|
47
|
+
- 9b9d2f4b-9d47-4fc6-9129-e97165453597
|
48
|
+
X-Runtime:
|
49
|
+
- '0.071172'
|
50
|
+
X-Xss-Protection:
|
51
|
+
- 1; mode=block
|
52
|
+
Transfer-Encoding:
|
53
|
+
- chunked
|
54
|
+
Connection:
|
55
|
+
- keep-alive
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"id":12473,"name":"Edools API Test","description":"Edools API test","image_url":null,"created_at":"2015-07-06
|
59
|
+
18:40:47 UTC","updated_at":"2015-07-06 18:42:43 UTC","duration":null,"path_ids":[],"forum_section_ids":[],"library_resource":{"id":121410,"school_products":[],"library":{"id":2},"library_tags":[]}}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Mon, 06 Jul 2015 18:42:56 GMT
|
62
|
+
- request:
|
63
|
+
method: delete
|
64
|
+
uri: https://core.edools.com/courses/12473.json
|
65
|
+
body:
|
66
|
+
encoding: US-ASCII
|
67
|
+
string: ''
|
68
|
+
headers:
|
69
|
+
Accept:
|
70
|
+
- application/vnd.edools.core.v1+json
|
71
|
+
Authorization:
|
72
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
73
|
+
Accept-Encoding:
|
74
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
75
|
+
User-Agent:
|
76
|
+
- Ruby
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 204
|
80
|
+
message: No Content
|
81
|
+
headers:
|
82
|
+
Cache-Control:
|
83
|
+
- no-cache
|
84
|
+
Content-Security-Policy-Report-Only:
|
85
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
86
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
87
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
88
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
89
|
+
Date:
|
90
|
+
- Mon, 06 Jul 2015 18:42:56 GMT
|
91
|
+
Server:
|
92
|
+
- nginx/1.4.7
|
93
|
+
Status:
|
94
|
+
- 204 No Content
|
95
|
+
Strict-Transport-Security:
|
96
|
+
- max-age=631152000; includeSubdomains
|
97
|
+
X-Content-Type-Options:
|
98
|
+
- nosniff
|
99
|
+
X-Frame-Options:
|
100
|
+
- DENY
|
101
|
+
X-Request-Id:
|
102
|
+
- 58b36f65-150b-40e2-ad51-9790eeb4af2a
|
103
|
+
X-Runtime:
|
104
|
+
- '0.100044'
|
105
|
+
X-Xss-Protection:
|
106
|
+
- 1; mode=block
|
107
|
+
Connection:
|
108
|
+
- keep-alive
|
109
|
+
body:
|
110
|
+
encoding: UTF-8
|
111
|
+
string: ''
|
112
|
+
http_version:
|
113
|
+
recorded_at: Mon, 06 Jul 2015 18:42:56 GMT
|
114
|
+
recorded_with: VCR 2.9.2
|