Last active
December 28, 2015 05:59
-
-
Save Alpa84/7454193 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mock_redis' | |
require 'spec_helper' | |
describe ApplicationController do | |
it "should return 200 as status" do | |
reponse = get "status" | |
response.status.should eq 200 | |
end | |
it "should return 200 as status" do | |
RedisConnection.instance.stub(:connection) { raise Redis::TimeoutError, "Connection timed out" } | |
Smrt::Record.stub(:connection) { raise "Connection timed out" } | |
Scr::Record.stub(:connection) { raise "Connection timed out" } | |
Backend::Record.stub(:connection) { raise "Connection timed out" } | |
DelayedJob::Record.stub(:connection) { raise "Connection timed out" } | |
Airbrake.should_receive(:notify) {#<RuntimeError: Connection timed out>")} | |
reponse = get "status" | |
response.status.should eq 200 | |
end | |
it "should return 200 as status" do | |
RedisConnection.instance.stub(:connection) { raise Redis::TimeoutError, "Connection timed out" } | |
Smrt::Record.stub(:connection) { "2" } | |
Scr::Record.stub(:connection) { "3" } | |
Backend::Record.stub(:connection) { "4"} | |
DelayedJob::Record.stub(:connection) { "5" } | |
Airbrake.should_receive(:notify).with"#<RuntimeError: Connection timed out>" | |
reponse = get "status" | |
response.status.should eq 200 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment