Sha256: 2a983d55d32b1df1142e111b5427ebbd38bf559202ce6335ca501275248f143e

Contents?: true

Size: 860 Bytes

Versions: 1

Compression:

Stored size: 860 Bytes

Contents

require 'spec_helper'

IronWorker.configure do |config|
    config.token = 'IRON_WORKER_TOKEN'
    config.project_id = 'IRON_WORKER_PROJECT_ID'
end

IronWorker.service.instance_eval do
	extend IronWorker::TestService::Schedule
end

describe "IronWorker::Base.schedule" do
	let!(:worker) { TestWorker.new }
	
  it "should add the worker to IronCuke.schedules" do
		expect {
			worker.schedule(:start_at => Time.now, :run_times => 1)
		}.to change{IronCuke.schedules.count}.by(1)
  end

  it "should set worker.response" do
		pending "There is a bug in IronWorker::Base where the response isn't set"
		expect {
			worker.schedule(:start_at => Time.now, :run_times => 1)
		}.to change{worker.response}
  end

  it "should set worker.schedule_id" do
		expect {
			worker.schedule(:start_at => Time.now, :run_times => 1)
		}.to change{worker.schedule_id}
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iron_cuke-0.0.1 spec/worker_integration/schedule_spec.rb