Skip to content

Adding the finish method to Job so it can finish live streaming jobs #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/zencoder/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@ def self.cancel(job_id, options={})
put("/jobs/#{job_id}/cancel", nil, options)
end

def self.finish(job_id, options={})
put("/jobs/#{job_id}/finish", nil, options)
end

end
end
12 changes: 12 additions & 0 deletions test/zencoder/job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,17 @@ class Zencoder::JobTest < Test::Unit::TestCase
end
end

context ".finish" do
setup do
@job_id = 1
@url = "#{Zencoder.base_url}/jobs/#{@job_id}/finish"
end

should "PUT the correct url and return a response" do
Zencoder::HTTP.stubs(:put).with(@url, nil, :headers => {"Zencoder-Api-Key" => @api_key}).returns(Zencoder::Response.new)
assert_equal Zencoder::Response, Zencoder::Job.finish(1, :api_key => @api_key).class
end
end

end
end