socialforge/spec/requests/zipdown_request_spec.rb

19 lines
655 B
Ruby

require 'rails_helper'
# "attachments"=>{"1"=>{"filename"=>"11.gif", "description"=>"", "is_public_checkbox"=>"1", "token"=>"33731.8a74e086d7716f89bc4fbac0606589c7"}}
RSpec.describe ZipdownController, :type => :controller do
describe "单独下载某学生作业" do
before {
session[:user_id] = 3135
session[:atime] = Time.now.utc.to_i
session[:ctime] = Time.now.utc.to_i
}
it "正常下载" do
get 'download_user_homework', {homework:24753}
expect(response).to have_http_status(:success)
expect(response.content_type).to eq(Mime::Type.new("applcation/zip",:zip))
end
end
end