spec/controllers/mediacasts_controller_spec.rb
# Test data has no entry with a single digit CCN. Using the ccn_sets below, we expect 'No Webcast data found' for
# each single digit ccn.
Test data has no entry with a single digit CCN. Using the ccn_sets below, we expect 'No Webcast data found' for
each single digit ccn.
Test data has no entry with a single digit CCN . Using the ccn_sets below we expect ' No Webcast data found ' for each single digit ccn .
def post_course(course)
    term_yr = course[:term_yr]
    term_cd = course[:term_cd]
    dept_name = course[:dept_name]
    catalog_id = course[:catalog_id]
    query_results = []
    course[:ccn_set].each {|ccn| query_results << { 'course_cntl_num' => "0#{ccn}" }}
    CampusOracle::Queries.should_receive(:get_all_course_sections).with(term_yr, term_cd, dept_name, catalog_id).and_return query_results
    post :get_media, year: term_yr, term_code: term_cd, dept: dept_name, catalog_id: catalog_id
    expect(response.status).to eq 200
    JSON.parse response.body
  end
def post_course ( course ) term_yr = course [ :term_yr ] term_cd = course [ :term_cd ] dept_name = course [ :dept_name ] catalog_id = course [ :catalog_id ] query_results = [ ] course [ :ccn_set ] . each { | ccn | query_results << { 'course_cntl_num' => "0#{ccn}" } } CampusOracle :: Queries . should_receive ( :get_all_course_sections ) . with ( term_yr , term_cd , dept_name , catalog_id ) . and_return query_results post :get_media , year : term_yr , term_code : term_cd , dept : dept_name , catalog_id : catalog_id expect ( response . status ) . to eq 200 JSON . parse response . body end
Test data has no entry with a single digit CCN.
Test data has no entry with a single digit CCN .
# :year/:term_code/:dept/:catalog_id # Add leading zero to CCN to verify proper handling
course