course_sections_spec.rb 661 Bytes
Newer Older
1
2
3
4
5
require 'rails_helper'
require 'rspec_api_documentation/dsl'

resource "Course Sections" do
  explanation "A way to search across the different course sections (i.e. CS 112 001, ECON 103 104) for each course"
Zac Wood's avatar
Zac Wood committed
6

7
8
9
  get "/api/course_sections" do
    parameter :course_id, type: :number
    parameter :crn, type: :string
Zac Wood's avatar
Zac Wood committed
10

11
12
13
    context '200' do
      let(:course_id) { 169421928 }
      let(:crn) { "70125" }
Zac Wood's avatar
Zac Wood committed
14

15
16
17
18
      example_request 'Search by CRN' do
        expect(status).to eq(200)
      end
    end
Zac Wood's avatar
Zac Wood committed
19

20
21
    context '200' do
      let(:course_id) { 169421928 }
Zac Wood's avatar
Zac Wood committed
22

23
24
25
26
27
28
      example_request 'Search by course' do
        expect(status).to eq(200)
      end
    end
  end
end