Skip to content

Commit

Permalink
Implemented Student type.
Browse files Browse the repository at this point in the history
  • Loading branch information
tszolar committed Aug 20, 2014
1 parent 2d70ba2 commit bf15458
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/kosapi_client/entity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
require 'kosapi_client/entity/course'
require 'kosapi_client/entity/timetable_slot'
require 'kosapi_client/entity/parallel'
require 'kosapi_client/entity/student'
33 changes: 33 additions & 0 deletions lib/kosapi_client/entity/student.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module KOSapiClient
module Entity
class Student < BaseEntity

include DataMappings

map_data :branch, Link
map_data :department , Link
map_data :email
map_data :start_date, Time
map_data :faculty, Link
map_data :first_name
map_data :grade, Integer
map_data :interrupted_until, Time
map_data :last_name
map_data :personal_number, Integer
map_data :programme, Link
map_data :end_date, Time
map_data :study_form, Enum
map_data :study_group, Integer
map_data :study_plan, Link
map_data :study_state, Enum
map_data :supervisor, Link
map_data :supervisor_specialist, Link
map_data :study_termination_reason, Enum
map_data :titles_post
map_data :titles_pre
map_data :username
map_data :code

end
end
end
5 changes: 5 additions & 0 deletions spec/integration/parallels_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@
expect(page.next.items.count).to be > 0
end

it 'returns students for a parallel' do
students = client.parallels.find(339540000).students.limit(20)
expect(students.count).to eq 15
end

end

0 comments on commit bf15458

Please sign in to comment.