forked from stringer-rss/stringer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_controller_spec.rb
More file actions
49 lines (38 loc) · 1.36 KB
/
debug_controller_spec.rb
File metadata and controls
49 lines (38 loc) · 1.36 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
require "spec_helper"
require "support/active_record"
app_require "controllers/debug_controller"
describe "DebugController" do
describe "GET /debug" do
before do
delayed_job = double "Delayed::Job"
delayed_job.stub(:count).and_return(42)
stub_const("Delayed::Job", delayed_job)
migration_status_instance = double "migration_status_instance"
migration_status_instance.stub(:pending_migrations).and_return ["Migration B - 2", "Migration C - 3"]
migration_status = double "MigrationStatus"
migration_status.stub(:new).and_return(migration_status_instance)
stub_const("MigrationStatus", migration_status)
end
it "displays the current Ruby version" do
get "/debug"
page = last_response.body
page.should have_tag("dd", text: /#{RUBY_VERSION}/)
end
it "displays the user agent" do
get "/debug", {}, { "HTTP_USER_AGENT" => "test" }
page = last_response.body
page.should have_tag("dd", text: /test/)
end
it "displays the delayed job count" do
get "/debug"
page = last_response.body
page.should have_tag("dd", text: /42/)
end
it "displays pending migrations" do
get "/debug"
page = last_response.body
page.should have_tag("li", text: /Migration B - 2/)
page.should have_tag("li", text: /Migration C - 3/)
end
end
end