Skip to content

Commit

Permalink
Fixing deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Aug 25, 2013
1 parent e0c4f04 commit 3a010d1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions spec/rack/insight/panels/active_record_panel_spec.rb
Expand Up @@ -9,10 +9,10 @@ module Rack::Insight
end

def mock_model(name)
model = stub("model")
model.stub!(:name => name)
obj = stub(name)
obj.stub!(:base_class => model)
model = double("model")
model.stub(:name => name)
obj = double(name)
obj.stub(:base_class => model)
obj
end

Expand Down
8 changes: 4 additions & 4 deletions spec/rack/insight/panels/active_resource_panel_spec.rb
Expand Up @@ -8,10 +8,10 @@ module Rack::Insight
end

def mock_model(name)
model = stub("model")
model.stub!(:name => name)
obj = stub(name)
obj.stub!(:base_class => model)
model = double("model")
model.stub(:name => name)
obj = double(name)
obj.stub(:base_class => model)
obj
end

Expand Down
12 changes: 6 additions & 6 deletions spec/rack/insight/panels/cache_panel_spec.rb
Expand Up @@ -122,7 +122,7 @@ module Rack::Insight

describe "expire_all" do
it "expires the cache keys" do
Rails.stub!(:cache => mock("cache"))
Rails.stub(:cache => mock("cache"))
Rails.cache.should_receive(:delete).with("user:1")
Rails.cache.should_receive(:delete).with("user:2")
Rails.cache.should_receive(:delete).with("user:3")
Expand All @@ -134,7 +134,7 @@ module Rack::Insight
end

it "returns OK" do
Rails.stub!(:cache => mock("cache", :delete => nil))
Rails.stub(:cache => mock("cache", :delete => nil))
response = get_via_rack "/__insight__/delete_cache_list",
:keys_1 => "user:1", :keys_2 => "user:2", :keys_3 => "user:3", :keys_4 => "user:4",
:hash => Digest::SHA1.hexdigest("abc:user:1:user:2:user:3:user:4")
Expand All @@ -144,14 +144,14 @@ module Rack::Insight

describe "expire" do
it "expires the cache key" do
Rails.stub!(:cache => mock("cache"))
Rails.stub(:cache => mock("cache"))
Rails.cache.should_receive(:delete).with("user:1")
get_via_rack "/__insight__/delete_cache", :key => "user:1",
:hash => Digest::SHA1.hexdigest("abc:user:1")
end

it "returns OK" do
Rails.stub!(:cache => mock("cache", :delete => nil))
Rails.stub(:cache => mock("cache", :delete => nil))
response = get_via_rack "/__insight__/delete_cache", :key => "user:1",
:hash => Digest::SHA1.hexdigest("abc:user:1")
response.should contain("OK")
Expand All @@ -160,14 +160,14 @@ module Rack::Insight

describe "view_cache" do
it "renders the cache key" do
Rails.stub!(:cache => mock("cache", :read => "cache body"))
Rails.stub(:cache => mock("cache", :read => "cache body"))
response = get_via_rack "/__insight__/view_cache", :key => "user:1",
:hash => Digest::SHA1.hexdigest("abc:user:1")
response.should contain("cache body")
end

it "renders non-String cache values properly" do
Rails.stub!(:cache => mock("cache", :read => [1, 2]))
Rails.stub(:cache => mock("cache", :read => [1, 2]))
response = get_via_rack "/__insight__/view_cache", :key => "user:1",
:hash => Digest::SHA1.hexdigest("abc:user:1")
response.should contain("[1, 2]")
Expand Down
8 changes: 4 additions & 4 deletions spec/rack/insight/panels/rails_info_panel_spec.rb
Expand Up @@ -7,21 +7,21 @@ module Rack::Insight
mock_constant("Rails::Info")
reset_insight :panel_classes => [Rack::Insight::RailsInfoPanel]

Rails::Info.stub!(:properties => [])
Rails::Info.stub(:properties => [])
end

describe "heading" do
it "displays the Rails version" do
Rails.stub!(:version => "v2.3.0")
Rails.stub(:version => "v2.3.0")
response = get_via_rack "/"
response.should have_heading("Rails v2.3.0")
end
end

describe "content" do
it "displays the Rails::Info properties" do
Rails.stub!(:version => "v2.3.0")
Rails::Info.stub!(:properties => [["Name", "Value"]])
Rails.stub(:version => "v2.3.0")
Rails::Info.stub(:properties => [["Name", "Value"]])
response = get_via_rack "/"
response.should have_row("#rails_info", "Name", "Value")
end
Expand Down
2 changes: 1 addition & 1 deletion spec/rack/insight/panels/speedtracer_panel_spec.rb
Expand Up @@ -16,7 +16,7 @@
# end
#
# def mock_template(path)
# template = stub("ActionView::Template")
# template = double("ActionView::Template")
# template.stub!(:virtual_path => path)
# template
# end
Expand Down

0 comments on commit 3a010d1

Please sign in to comment.