File tree Expand file tree Collapse file tree 3 files changed +74
-0
lines changed
Expand file tree Collapse file tree 3 files changed +74
-0
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ git://github.com/brianmario/yajl-ruby.git 0.6.3
33git://github.com/sinatra/sinatra.git 0.9.4
44git://github.com/rack/rack.git 1.0
55git://github.com/quirkey/vegas.git v0.1.2
6+ git://github.com/brynary/rack-test.git v0.5.3
67rake
Original file line number Diff line number Diff line change 1+ require 'rack/test'
2+ require 'resque/server'
3+
4+ module Resque
5+ module TestHelper
6+ class Test ::Unit ::TestCase
7+ include Rack ::Test ::Methods
8+ def app
9+ Resque ::Server . new
10+ end
11+
12+ def self . should_respond_with_success
13+ test "should respond with success" do
14+ assert last_response . ok?
15+ end
16+ end
17+ end
18+ end
19+ end
Original file line number Diff line number Diff line change 1+ require File . dirname ( __FILE__ ) + '/test_helper'
2+ require 'resque/server/test_helper'
3+
4+ # Root path test
5+ context "on GET to /" do
6+ setup { get "/" }
7+
8+ test "redirect to overview" do
9+ follow_redirect!
10+ end
11+ end
12+
13+ # Global overview
14+ context "on GET to /overview" do
15+ setup { get "/overview" }
16+
17+ test "should at least display 'queues'" do
18+ assert last_response . body . include? ( 'Queues' )
19+ end
20+ end
21+
22+ # Working jobs
23+ context "on GET to /working" do
24+ setup { get "/working" }
25+
26+ should_respond_with_success
27+ end
28+
29+ # Failed
30+ context "on GET to /failed" do
31+ setup { get "/failed" }
32+
33+ should_respond_with_success
34+ end
35+
36+ # Stats
37+ context "on GET to /stats/resque" do
38+ setup { get "/stats/resque" }
39+
40+ should_respond_with_success
41+ end
42+
43+ context "on GET to /stats/redis" do
44+ setup { get "/stats/redis" }
45+
46+ should_respond_with_success
47+ end
48+
49+ context "on GET to /stats/resque" do
50+ setup { get "/stats/keys" }
51+
52+ should_respond_with_success
53+ end
54+
You can’t perform that action at this time.
0 commit comments