require 'travis/github_sync/api/user/education'
require 'travis/github_sync/support/logger'

describe Travis::GithubSync::Api::User::Education do
  let(:user)   { model(:user).create(name: 'user', login: 'user', github_id: 2208, github_oauth_token: '123') }
  subject      { described_class.new(user.id) }

  describe 'for a student' do
    before { stub_github(Github::Education::User.student) }

    it 'returns true for a student' do
      expect(subject.student?).to eql(true)
    end
  end

  describe 'for a non-student' do
    before { stub_github(Github::Education::User.non_student) }

    it 'returns true for a student' do
      expect(subject.student?).to eql(false)
    end
  end
end
