forked from resque/resque
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresque-web_test.rb
More file actions
71 lines (53 loc) · 1.25 KB
/
resque-web_test.rb
File metadata and controls
71 lines (53 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
require 'test_helper'
require 'resque/server/test_helper'
# Root path test
describe "on GET to /" do
before { get "/" }
it "redirect to overview" do
follow_redirect!
end
end
# Global overview
describe "on GET to /overview" do
before { get "/overview" }
it "should at least display 'queues'" do
assert last_response.body.include?('Queues')
end
end
# Working jobs
describe "on GET to /working" do
before { get "/working" }
should_respond_with_success
end
# Failed
describe "on GET to /failed" do
before { get "/failed" }
should_respond_with_success
end
# Stats
describe "on GET to /stats/resque" do
before { get "/stats/resque" }
should_respond_with_success
end
describe "on GET to /stats/redis" do
before { get "/stats/redis" }
should_respond_with_success
end
describe "on GET to /stats/resque" do
before { get "/stats/keys" }
should_respond_with_success
end
describe "also works with slash at the end" do
before { get "/working/" }
should_respond_with_success
end
describe "on POST to /failed/requeue/all" do
before {
add_failed_jobs
post "/failed/requeue/all"
}
it "should redirect to /failed and contain '0 jobs'" do
follow_redirect!
assert last_response.body.include?('<b>0</b> jobs')
end
end