learnsprout 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/README.md +4 -0
- data/features/courses.feature +52 -0
- data/features/orgs.feature +13 -0
- data/features/schools.feature +25 -0
- data/features/sections.feature +44 -0
- data/features/step_definitions/client_steps.rb +268 -0
- data/features/students.feature +44 -0
- data/features/teachers.feature +44 -0
- data/features/term.feature +56 -0
- data/learnsprout.gemspec +28 -0
- data/lib/learnsprout/address.rb +16 -0
- data/lib/learnsprout/client.rb +209 -0
- data/lib/learnsprout/connection.rb +45 -0
- data/lib/learnsprout/course.rb +25 -0
- data/lib/learnsprout/exceptions.rb +5 -0
- data/lib/learnsprout/nces.rb +12 -0
- data/lib/learnsprout/org.rb +62 -0
- data/lib/learnsprout/phone.rb +12 -0
- data/lib/learnsprout/response/follow_redirects.rb +44 -0
- data/lib/learnsprout/response/parse_json.rb +22 -0
- data/lib/learnsprout/school.rb +69 -0
- data/lib/learnsprout/section.rb +18 -0
- data/lib/learnsprout/student.rb +16 -0
- data/lib/learnsprout/teacher.rb +30 -0
- data/lib/learnsprout/term.rb +22 -0
- data/lib/learnsprout/version.rb +4 -0
- data/lib/learnsprout.rb +48 -0
- metadata +196 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
Feature: Get Courses
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about courses for an organization
|
4
|
+
|
5
|
+
Scenario: List courses by org id
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request courses for an organization with id 4fdaeaa92eea44952ab9e520
|
8
|
+
* I should get a list of 23 courses
|
9
|
+
|
10
|
+
Scenario: List courses by org
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* When I request courses for that org
|
14
|
+
* I should get a list of 23 courses
|
15
|
+
|
16
|
+
Scenario: List courses by org id and school id
|
17
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
18
|
+
* When I request courses for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86faa411b22c9a3fd2f
|
19
|
+
* I should get a list of 18 courses
|
20
|
+
|
21
|
+
Scenario: List courses by school
|
22
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
23
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
24
|
+
* I request a school with id 4fdac86faa411b22c9a3fd2f for that org
|
25
|
+
* When I request courses for that school
|
26
|
+
* I should get a list of 18 courses
|
27
|
+
|
28
|
+
Scenario: Course by school and course id
|
29
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
30
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
31
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
32
|
+
* When I request a course with id 4fdac84eaa411b22c9a3fd17 for that school
|
33
|
+
* I should get a course with id 4fdac84eaa411b22c9a3fd17
|
34
|
+
|
35
|
+
Scenario: Course by org id and course id
|
36
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
37
|
+
* When I request a course with id 4fdac84eaa411b22c9a3fd17 for an org with id 4fdaeaa92eea44952ab9e520
|
38
|
+
* I should get a course with id 4fdac84eaa411b22c9a3fd17
|
39
|
+
|
40
|
+
Scenario: Course by org and course id
|
41
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
42
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
43
|
+
* When I request a course with id 4fdac84eaa411b22c9a3fd17 for that org
|
44
|
+
* I should get a course with id 4fdac84eaa411b22c9a3fd17
|
45
|
+
|
46
|
+
Scenario: School for course
|
47
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
48
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
49
|
+
* I request a course with id 4fdac84eaa411b22c9a3fd17 for that org
|
50
|
+
* I request the school for that course
|
51
|
+
* I should get a school with id 4fdac86faa411b22c9a3fd2f
|
52
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Get Orgs
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about all organizations I have access to
|
4
|
+
|
5
|
+
Scenario: List all orgs
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request orgs
|
8
|
+
* I should get the organization with id 4fdaeaa92eea44952ab9e520
|
9
|
+
|
10
|
+
Scenario: Org by ID
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* When I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* I should get an organization with id 4fdaeaa92eea44952ab9e520
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Feature: Get Schools
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about schools for an organization
|
4
|
+
|
5
|
+
Scenario: List schools by org id
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request schools for an organization with id 4fdaeaa92eea44952ab9e520
|
8
|
+
* I should get a list of 7 schools
|
9
|
+
|
10
|
+
Scenario: List schools by org
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* When I request schools for that org
|
14
|
+
* I should get a list of 7 schools
|
15
|
+
|
16
|
+
Scenario: School by org id and school id
|
17
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
18
|
+
* When I request a school with id 4fdac86eaa411b22c9a3fd2e for an org with id 4fdaeaa92eea44952ab9e520
|
19
|
+
* I should get a school with id 4fdac86eaa411b22c9a3fd2e
|
20
|
+
|
21
|
+
Scenario: School by org and school id
|
22
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
23
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
24
|
+
* When I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
25
|
+
* I should get a school with id 4fdac86eaa411b22c9a3fd2e
|
@@ -0,0 +1,44 @@
|
|
1
|
+
Feature: Get Sections
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about sections for an organization
|
4
|
+
|
5
|
+
Scenario: List sections by org id
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request sections for an organization with id 4fdaeaa92eea44952ab9e520
|
8
|
+
* I should get a list of 50 sections
|
9
|
+
|
10
|
+
Scenario: List sections by org
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* When I request sections for that org
|
14
|
+
* I should get a list of 50 sections
|
15
|
+
|
16
|
+
Scenario: List sections by org id and school id
|
17
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
18
|
+
* When I request sections for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
|
19
|
+
* I should get a list of 50 sections
|
20
|
+
|
21
|
+
Scenario: List sections by school
|
22
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
23
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
24
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
25
|
+
* When I request sections for that school
|
26
|
+
* I should get a list of 50 sections
|
27
|
+
|
28
|
+
Scenario: Section by school and section id
|
29
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
30
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
31
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
32
|
+
* When I request a section with id 4fdb1f6691e4e649b7000000 for that school
|
33
|
+
* I should get a section with id 4fdb1f6691e4e649b7000000
|
34
|
+
|
35
|
+
Scenario: Section by org id and section id
|
36
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
37
|
+
* When I request a section with id 4fdb1f6691e4e649b7000000 for an org with id 4fdaeaa92eea44952ab9e520
|
38
|
+
* I should get a section with id 4fdb1f6691e4e649b7000000
|
39
|
+
|
40
|
+
Scenario: Section by org and section id
|
41
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
42
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
43
|
+
* When I request a section with id 4fdb1f6691e4e649b7000000 for that org
|
44
|
+
* I should get a section with id 4fdb1f6691e4e649b7000000
|
@@ -0,0 +1,268 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
|
3
|
+
require 'cucumber/formatter/unicode'
|
4
|
+
$:.unshift(File.dirname(__FILE__) + '/../../lib')
|
5
|
+
require 'learnsprout'
|
6
|
+
|
7
|
+
Before do
|
8
|
+
end
|
9
|
+
|
10
|
+
After do
|
11
|
+
end
|
12
|
+
|
13
|
+
# Client
|
14
|
+
|
15
|
+
Given /^I have entered my api key as ([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$/ do |api_key|
|
16
|
+
@client = LearnSprout::Client.new(api_key)
|
17
|
+
end
|
18
|
+
|
19
|
+
Given /^(?:When )?I request orgs$/ do
|
20
|
+
@orgs = @client.orgs
|
21
|
+
end
|
22
|
+
|
23
|
+
Given /^I should get the organization with id ([a-f0-9]{24})$/ do |org_id|
|
24
|
+
org = @orgs.first
|
25
|
+
org.org_id.should == org_id
|
26
|
+
end
|
27
|
+
|
28
|
+
Given /^I should get an organization with id ([a-f0-9]{24})$/ do |org_id|
|
29
|
+
@org.org_id.should == org_id
|
30
|
+
end
|
31
|
+
|
32
|
+
Given /^(?:When )?I request an org with id ([a-f0-9]{24})$/ do |org_id|
|
33
|
+
@org = @client.org(org_id)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Schools
|
37
|
+
|
38
|
+
Given /^(?:When )?I request schools for an organization with id ([a-f0-9]{24})$/ do |org_id|
|
39
|
+
@schools = @client.schools(org_id)
|
40
|
+
end
|
41
|
+
|
42
|
+
Given /^I should get a list of (\d+) schools$/ do |count|
|
43
|
+
@schools.count.should == Integer(count)
|
44
|
+
end
|
45
|
+
|
46
|
+
Given /^(?:When )?I request a school with id ([a-f0-9]{24}) for that org$/ do |school_id|
|
47
|
+
@school = @org.school(school_id)
|
48
|
+
end
|
49
|
+
|
50
|
+
Given /^I should get a school with id ([a-f0-9]{24})$/ do |school_id|
|
51
|
+
@school.school_id.should == school_id
|
52
|
+
end
|
53
|
+
|
54
|
+
Given /^(?:When )?I request schools for that org$/ do
|
55
|
+
@schools = @org.schools
|
56
|
+
end
|
57
|
+
|
58
|
+
Given /^(?:When )?I request a school with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |school_id, org_id|
|
59
|
+
@school = @client.school(org_id, school_id)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Students
|
63
|
+
|
64
|
+
Given /^(?:When )?I request students for an organization with id ([a-f0-9]{24})$/ do |org_id|
|
65
|
+
@students = @client.students(org_id)
|
66
|
+
end
|
67
|
+
|
68
|
+
Given /^I should get a list of (\d+) students$/ do |count|
|
69
|
+
@students.count.should == Integer(count)
|
70
|
+
end
|
71
|
+
|
72
|
+
Given /^(?:When )?I request students for that org$/ do
|
73
|
+
@students = @org.students
|
74
|
+
end
|
75
|
+
|
76
|
+
Given /^I should get a student with id ([a-f0-9]{24})$/ do |student_id|
|
77
|
+
@student.student_id.should == student_id
|
78
|
+
end
|
79
|
+
|
80
|
+
Given /^(?:When )?I request a student with id ([a-f0-9]{24}) for that school$/ do |student_id|
|
81
|
+
@student = @school.student(student_id)
|
82
|
+
end
|
83
|
+
|
84
|
+
Given /^(?:When )?I request a student with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |student_id, org_id|
|
85
|
+
@student = @client.student(org_id, student_id)
|
86
|
+
end
|
87
|
+
|
88
|
+
Given /^(?:When )?I request a student with id ([a-f0-9]{24}) for that org$/ do |student_id|
|
89
|
+
@student = @org.student(student_id)
|
90
|
+
end
|
91
|
+
|
92
|
+
Given /^(?:When )?I request students for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
|
93
|
+
@students = @client.students(org_id, school_id)
|
94
|
+
end
|
95
|
+
|
96
|
+
Given /^(?:When )?I request students for that school$/ do
|
97
|
+
@students = @school.students
|
98
|
+
end
|
99
|
+
|
100
|
+
# Sections
|
101
|
+
|
102
|
+
Given /^When I request sections for an organization with id ([a-f0-9]{24})$/ do |org_id|
|
103
|
+
@sections = @client.sections(org_id)
|
104
|
+
end
|
105
|
+
|
106
|
+
Given /^I should get a list of (\d+) sections$/ do |count|
|
107
|
+
@sections.count.should == Integer(count)
|
108
|
+
end
|
109
|
+
|
110
|
+
Given /^(?:When )?I request sections for that org$/ do
|
111
|
+
@sections = @org.sections
|
112
|
+
end
|
113
|
+
|
114
|
+
Given /^(?:When )?I request sections for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
|
115
|
+
@sections = @client.sections(org_id, :school_id => school_id)
|
116
|
+
end
|
117
|
+
|
118
|
+
Given /^(?:When )?I request sections for that school$/ do
|
119
|
+
@sections = @school.sections
|
120
|
+
end
|
121
|
+
|
122
|
+
Given /^(?:When )?I request a section with id ([a-f0-9]{24}) for that school$/ do |section_id|
|
123
|
+
@section = @school.section(section_id)
|
124
|
+
end
|
125
|
+
|
126
|
+
Given /^I should get a section with id ([a-f0-9]{24})$/ do |section_id|
|
127
|
+
@section.section_id.should == section_id
|
128
|
+
end
|
129
|
+
|
130
|
+
Given /^(?:When )?I request a section with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |section_id, org_id|
|
131
|
+
@section = @client.section(org_id, section_id)
|
132
|
+
end
|
133
|
+
|
134
|
+
Given /^(?:When )?I request a section with id ([a-f0-9]{24}) for that org$/ do |section_id|
|
135
|
+
@section = @org.section(section_id)
|
136
|
+
end
|
137
|
+
|
138
|
+
# Teachers
|
139
|
+
|
140
|
+
Given /^When I request teachers for an organization with id ([a-f0-9]{24})$/ do |org_id|
|
141
|
+
@teachers = @client.teachers(org_id)
|
142
|
+
end
|
143
|
+
|
144
|
+
Given /^I should get a list of (\d+) teachers$/ do |count|
|
145
|
+
@teachers.count.should == Integer(count)
|
146
|
+
end
|
147
|
+
|
148
|
+
Given /^(?:When )?I request teachers for that org$/ do
|
149
|
+
@teachers = @org.teachers
|
150
|
+
end
|
151
|
+
|
152
|
+
Given /^(?:When )?I request teachers for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
|
153
|
+
@teachers = @client.teachers(org_id, :school_id => school_id)
|
154
|
+
end
|
155
|
+
|
156
|
+
Given /^(?:When )?I request teachers for that school$/ do
|
157
|
+
@teachers = @school.teachers
|
158
|
+
end
|
159
|
+
|
160
|
+
Given /^(?:When )?I request a teacher with id ([a-f0-9]{24}) for that school$/ do |teacher_id|
|
161
|
+
@teacher = @school.teacher(teacher_id)
|
162
|
+
end
|
163
|
+
|
164
|
+
Given /^I should get a teacher with id ([a-f0-9]{24})$/ do |teacher_id|
|
165
|
+
@teacher.teacher_id.should == teacher_id
|
166
|
+
end
|
167
|
+
|
168
|
+
Given /^(?:When )?I request a teacher with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |teacher_id, org_id|
|
169
|
+
@teacher = @client.teacher(org_id, teacher_id)
|
170
|
+
end
|
171
|
+
|
172
|
+
Given /^(?:When )?I request a teacher with id ([a-f0-9]{24}) for that org$/ do |teacher_id|
|
173
|
+
@teacher = @org.teacher(teacher_id)
|
174
|
+
end
|
175
|
+
|
176
|
+
# Terms
|
177
|
+
|
178
|
+
Given /^When I request terms for an organization with id ([a-f0-9]{24})$/ do |org_id|
|
179
|
+
@terms = @client.terms(org_id)
|
180
|
+
end
|
181
|
+
|
182
|
+
Given /^I should get a list of (\d+) terms$/ do |count|
|
183
|
+
@terms.count.should == Integer(count)
|
184
|
+
end
|
185
|
+
|
186
|
+
Given /^(?:When )?I request terms for that org$/ do
|
187
|
+
@terms = @org.terms
|
188
|
+
end
|
189
|
+
|
190
|
+
Given /^(?:When )?I request terms for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
|
191
|
+
@terms = @client.terms(org_id, :school_id => school_id)
|
192
|
+
end
|
193
|
+
|
194
|
+
Given /^(?:When )?I request terms for that school$/ do
|
195
|
+
@terms = @school.terms
|
196
|
+
end
|
197
|
+
|
198
|
+
Given /^(?:When )?I request a term with id ([a-f0-9]{24}) for that school$/ do |term_id|
|
199
|
+
@term = @school.term(term_id)
|
200
|
+
end
|
201
|
+
|
202
|
+
Given /^I should get a term with id ([a-f0-9]{24})$/ do |term_id|
|
203
|
+
@term.term_id.should == term_id
|
204
|
+
end
|
205
|
+
|
206
|
+
Given /^(?:When )?I request a term with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |term_id, org_id|
|
207
|
+
@term = @client.term(org_id, term_id)
|
208
|
+
end
|
209
|
+
|
210
|
+
Given /^(?:When )?I request a term with id ([a-f0-9]{24}) for that org$/ do |term_id|
|
211
|
+
@term = @org.term(term_id)
|
212
|
+
end
|
213
|
+
|
214
|
+
Given /^(?:When )?I request the current term for that school$/ do
|
215
|
+
@term = @school.current_term
|
216
|
+
end
|
217
|
+
|
218
|
+
Given /^I should get the current term$/ do
|
219
|
+
Date.today.should >= @term.start_date
|
220
|
+
Date.today.should <= @term.end_date
|
221
|
+
end
|
222
|
+
|
223
|
+
Given /^(?:When )?I request the current term for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
|
224
|
+
@term = @client.current_term(org_id, school_id)
|
225
|
+
end
|
226
|
+
|
227
|
+
# Courses
|
228
|
+
|
229
|
+
Given /^When I request courses for an organization with id ([a-f0-9]{24})$/ do |org_id|
|
230
|
+
@courses = @client.courses(org_id)
|
231
|
+
end
|
232
|
+
|
233
|
+
Given /^I should get a list of (\d+) courses$/ do |count|
|
234
|
+
@courses.count.should == Integer(count)
|
235
|
+
end
|
236
|
+
|
237
|
+
Given /^(?:When )?I request courses for that org$/ do
|
238
|
+
@courses = @org.courses
|
239
|
+
end
|
240
|
+
|
241
|
+
Given /^(?:When )?I request courses for an org with id ([a-f0-9]{24}) and a school with id ([a-f0-9]{24})$/ do |org_id, school_id|
|
242
|
+
@courses = @client.courses(org_id, :school_id => school_id)
|
243
|
+
end
|
244
|
+
|
245
|
+
Given /^(?:When )?I request courses for that school$/ do
|
246
|
+
@courses = @school.courses
|
247
|
+
end
|
248
|
+
|
249
|
+
Given /^(?:When )?I request a course with id ([a-f0-9]{24}) for that school$/ do |course_id|
|
250
|
+
@course = @school.course(course_id)
|
251
|
+
end
|
252
|
+
|
253
|
+
Given /^I should get a course with id ([a-f0-9]{24})$/ do |course_id|
|
254
|
+
@course.course_id.should == course_id
|
255
|
+
end
|
256
|
+
|
257
|
+
Given /^(?:When )?I request a course with id ([a-f0-9]{24}) for an org with id ([a-f0-9]{24})$/ do |course_id, org_id|
|
258
|
+
@course = @client.course(org_id, course_id)
|
259
|
+
end
|
260
|
+
|
261
|
+
Given /^(?:When )?I request a course with id ([a-f0-9]{24}) for that org$/ do |course_id|
|
262
|
+
@course = @org.course(course_id)
|
263
|
+
end
|
264
|
+
|
265
|
+
Given /^I request the school for that course$/ do
|
266
|
+
@school = @course.school
|
267
|
+
end
|
268
|
+
|
@@ -0,0 +1,44 @@
|
|
1
|
+
Feature: Get Students
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about students for an organization
|
4
|
+
|
5
|
+
Scenario: List students by org id
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request students for an organization with id 4fdaeaa92eea44952ab9e520
|
8
|
+
* I should get a list of 50 students
|
9
|
+
|
10
|
+
Scenario: List students by org
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* When I request students for that org
|
14
|
+
* I should get a list of 50 students
|
15
|
+
|
16
|
+
Scenario: List students by org id and school id
|
17
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
18
|
+
* When I request students for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
|
19
|
+
* I should get a list of 50 students
|
20
|
+
|
21
|
+
Scenario: List students by school
|
22
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
23
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
24
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
25
|
+
* When I request students for that school
|
26
|
+
* I should get a list of 50 students
|
27
|
+
|
28
|
+
Scenario: Student by org id and student id
|
29
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
30
|
+
* When I request a student with id 4fdaca11aa411b22c9a3fd35 for an org with id 4fdaeaa92eea44952ab9e520
|
31
|
+
* I should get a student with id 4fdaca11aa411b22c9a3fd35
|
32
|
+
|
33
|
+
Scenario: Student by org and student id
|
34
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
35
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
36
|
+
* When I request a student with id 4fdaca11aa411b22c9a3fd35 for that org
|
37
|
+
* I should get a student with id 4fdaca11aa411b22c9a3fd35
|
38
|
+
|
39
|
+
Scenario: Student by school and student id
|
40
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
41
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
42
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
43
|
+
* When I request a student with id 4fdaca11aa411b22c9a3fd35 for that school
|
44
|
+
* I should get a student with id 4fdaca11aa411b22c9a3fd35
|
@@ -0,0 +1,44 @@
|
|
1
|
+
Feature: Get Teachers
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about teachers for an organization
|
4
|
+
|
5
|
+
Scenario: List teachers by org id
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request teachers for an organization with id 4fdaeaa92eea44952ab9e520
|
8
|
+
* I should get a list of 50 teachers
|
9
|
+
|
10
|
+
Scenario: List teachers by org
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* When I request teachers for that org
|
14
|
+
* I should get a list of 50 teachers
|
15
|
+
|
16
|
+
Scenario: List teachers by org id and school id
|
17
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
18
|
+
* When I request teachers for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
|
19
|
+
* I should get a list of 28 teachers
|
20
|
+
|
21
|
+
Scenario: List teachers by school
|
22
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
23
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
24
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
25
|
+
* When I request teachers for that school
|
26
|
+
* I should get a list of 28 teachers
|
27
|
+
|
28
|
+
Scenario: Teacher by school and teacher id
|
29
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
30
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
31
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
32
|
+
* When I request a teacher with id 4fdb1fceaa411b22c9a49d54 for that school
|
33
|
+
* I should get a teacher with id 4fdb1fceaa411b22c9a49d54
|
34
|
+
|
35
|
+
Scenario: Teacher by org id and teacher id
|
36
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
37
|
+
* When I request a teacher with id 4fdb1fceaa411b22c9a49d54 for an org with id 4fdaeaa92eea44952ab9e520
|
38
|
+
* I should get a teacher with id 4fdb1fceaa411b22c9a49d54
|
39
|
+
|
40
|
+
Scenario: Teacher by org and teacher id
|
41
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
42
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
43
|
+
* When I request a teacher with id 4fdb1fceaa411b22c9a49d54 for that org
|
44
|
+
* I should get a teacher with id 4fdb1fceaa411b22c9a49d54
|
@@ -0,0 +1,56 @@
|
|
1
|
+
Feature: Get Terms
|
2
|
+
As a developer interested in educational organizations
|
3
|
+
I want to be able to retrieve information about terms for an organization
|
4
|
+
|
5
|
+
Scenario: List terms by org id
|
6
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
7
|
+
* When I request terms for an organization with id 4fdaeaa92eea44952ab9e520
|
8
|
+
* I should get a list of 20 terms
|
9
|
+
|
10
|
+
Scenario: List terms by org
|
11
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
12
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
13
|
+
* When I request terms for that org
|
14
|
+
* I should get a list of 20 terms
|
15
|
+
|
16
|
+
Scenario: List terms by org id and school id
|
17
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
18
|
+
* When I request terms for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
|
19
|
+
* I should get a list of 1 terms
|
20
|
+
|
21
|
+
Scenario: List terms by school
|
22
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
23
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
24
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
25
|
+
* When I request terms for that school
|
26
|
+
* I should get a list of 1 terms
|
27
|
+
|
28
|
+
Scenario: Term by school and term id
|
29
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
30
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
31
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
32
|
+
* When I request a term with id 4fdb21cb91e4e64a06000008 for that school
|
33
|
+
* I should get a term with id 4fdb21cb91e4e64a06000008
|
34
|
+
|
35
|
+
Scenario: Term by org id and term id
|
36
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
37
|
+
* When I request a term with id 4fdb21cb91e4e64a06000008 for an org with id 4fdaeaa92eea44952ab9e520
|
38
|
+
* I should get a term with id 4fdb21cb91e4e64a06000008
|
39
|
+
|
40
|
+
Scenario: Term by org and term id
|
41
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
42
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
43
|
+
* When I request a term with id 4fdb21cb91e4e64a06000008 for that org
|
44
|
+
* I should get a term with id 4fdb21cb91e4e64a06000008
|
45
|
+
|
46
|
+
Scenario: Current term by school
|
47
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
48
|
+
* I request an org with id 4fdaeaa92eea44952ab9e520
|
49
|
+
* I request a school with id 4fdac86eaa411b22c9a3fd2e for that org
|
50
|
+
* When I request the current term for that school
|
51
|
+
* I should get the current term
|
52
|
+
|
53
|
+
Scenario: Current term by org id and school id
|
54
|
+
* I have entered my api key as fcb8534c-e4ee-4e02-8b22-9328db1dac18
|
55
|
+
* When I request the current term for an org with id 4fdaeaa92eea44952ab9e520 and a school with id 4fdac86eaa411b22c9a3fd2e
|
56
|
+
* I should get the current term
|
data/learnsprout.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "learnsprout/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "learnsprout"
|
7
|
+
s.version = LearnSprout::VERSION
|
8
|
+
s.authors = ["Francis Kam"]
|
9
|
+
s.email = ["kabuko@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/kabuko/learnsprout"
|
11
|
+
s.summary = %q{A Ruby wrapper for the LearnSprout API.}
|
12
|
+
s.description = %q{A Ruby wrapper for the LearnSprout API.}
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
|
19
|
+
s.add_dependency 'faraday', '>= 0.7.6'
|
20
|
+
s.add_dependency 'multi_json', '~> 1.0'
|
21
|
+
|
22
|
+
s.add_development_dependency 'bundler'
|
23
|
+
s.add_development_dependency 'cucumber'
|
24
|
+
s.add_development_dependency 'rake'
|
25
|
+
s.add_development_dependency 'rspec'
|
26
|
+
s.add_development_dependency 'webmock'
|
27
|
+
s.add_development_dependency 'simplecov'
|
28
|
+
end
|