Sha256: 8d8daa2ff66262aff409d96d3052c1f88940250ae2550436953d9b1add01863b

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

require 'test_helper'

class ListTest < Test::Unit::TestCase
  def setup
    Clever.configure do |config|
      config.api_key = "DEMO_KEY"
    end
  end

  should "retrieve districts" do
    VCR.use_cassette("districts") do
      @districts = Clever::District.all
    end

    @districts.count.must_equal 1
  end

  should "retrieve schools" do
    VCR.use_cassette("schools") do
      @schools = Clever::School.all
    end

    @schools.count.must_equal 4
  end

  should "retrieve students" do
    VCR.use_cassette("students") do
      @students = Clever::Student.all
    end

    @students.count.must_equal 100
  end

  should "retrieve sections" do
    VCR.use_cassette("sections") do
      @sections = Clever::Section.all
    end

    @sections.count.must_equal 44
  end

  should "retrieve teachers" do
    VCR.use_cassette("teachers") do
      @teachers = Clever::Teacher.all

      @teachers.each do |teacher|
        teacher_obj = Clever::Teacher.retrieve teacher.id
        assert_instance_of(Clever::Teacher, teacher)
        assert_instance_of(Clever::Teacher, teacher_obj)
        assert_equal(teacher, teacher_obj)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
clever-ruby-0.3.1 test/integration/api_operations/list_test.rb
clever-ruby-0.3.0 test/integration/api_operations/list_test.rb
clever-ruby-0.2.0 test/integration/api_operations/list_test.rb
clever-ruby-0.1.0 test/integration/api_operations/list_test.rb
clever-ruby-0.0.5 test/integration/api_operations/list_test.rb
clever-ruby-0.0.4 test/integration/api_operations/list_test.rb
clever-ruby-0.0.3 test/integration/api_operations/list_test.rb
clever-ruby-0.0.2 test/integration/api_operations/list_test.rb
clever-ruby-0.0.1 test/integration/api_operations/list_test.rb