Sha256: af812bbd47e13c1b1b30c817016cc98f3936a4bcf6fd8e5be429c87045f400bc

Contents?: true

Size: 684 Bytes

Versions: 15

Compression:

Stored size: 684 Bytes

Contents

require "spec_helper"

describe Que::Web::Viewmodels::JobList do
  let(:job) {
    {"priority"=>100, "run_at"=> Time.now,
     "job_id"=>555, "job_class"=>"SuccessJob",
     "args"=>["arg1", {"name"=>"foo", "age"=>10}],
     "error_count"=>0,
     "last_error"=>nil,
     "queue"=>"foo"
    }
  }
  let(:pager) { Que::Web::Pager.new(1,10,105) }
  let(:subject) { Que::Web::Viewmodels::JobList.new([job], pager) }

  it "maps jobs" do
    subject.page_jobs.length.must_equal 1
    subject.page_jobs.first.queue.must_equal "foo"
  end

  it "exposes pager" do
    subject.pager.must_equal pager
  end

  it "maps total from pager" do
    subject.total.must_equal pager.total
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
que-web-0.7.2 spec/viewmodels/job_list_spec.rb
que-web-0.7.1 spec/viewmodels/job_list_spec.rb
que-web-0.7.0 spec/viewmodels/job_list_spec.rb
que-web-0.6.3 spec/viewmodels/job_list_spec.rb
que-web-0.6.2 spec/viewmodels/job_list_spec.rb
que-web-0.6.1 spec/viewmodels/job_list_spec.rb
que-web-0.6.0 spec/viewmodels/job_list_spec.rb
que-web-0.5.0 spec/viewmodels/job_list_spec.rb
que-web-0.4.0 spec/viewmodels/job_list_spec.rb
que-web-0.3.2 spec/viewmodels/job_list_spec.rb
que-web-0.3.1 spec/viewmodels/job_list_spec.rb
que-web-0.3.0 spec/viewmodels/job_list_spec.rb
que-web-0.2.2 spec/viewmodels/job_list_spec.rb
que-web-0.2.1 spec/viewmodels/job_list_spec.rb
que-web-0.2.0 spec/viewmodels/job_list_spec.rb