spec/justlogging/railtie_spec.rb in justlogging-rails-0.0.5 vs spec/justlogging/railtie_spec.rb in justlogging-rails-0.0.6
- old
+ new
@@ -1,47 +1,43 @@
require 'spec_helper'
require 'action_controller/railtie'
require 'justlogging/railtie'
describe Justlogging::Railtie do
+ before(:all) { MyApp::Application.initialize! }
- before :all do
- MyApp::Application.initialize!
- end
-
it "should have set the justlogging subscriber" do
- Justlogging.subscriber.should be_a ActiveSupport::Notifications::Fanout::Subscriber
+ Justlogging.subscriber.
+ should be_a ActiveSupport::Notifications::Fanout::Subscriber
end
it "should have added the middleware for exceptions" do
- MyApp::Application.middleware.middlewares.should include Justlogging::Middleware
+ MyApp::Application.middleware.to_a.should include Justlogging::Middleware
end
context "non action_controller event" do
it "should call add_event for non action_controller event" do
current = stub
current.should_receive(:add_event)
- Justlogging::Transaction.should_receive(:current).twice.and_return(current)
+ Justlogging::Transaction.should_receive(:current).twice.
+ and_return(current)
end
- after do
- ActiveSupport::Notifications.instrument 'query.mongoid'
- end
-
+ after { ActiveSupport::Notifications.instrument 'query.mongoid' }
end
context "action_controller event" do
it "should call set_log_entry for action_controller event" do
current = stub
current.should_receive(:set_log_entry)
- Justlogging::Transaction.should_receive(:current).twice.and_return(current)
+ Justlogging::Transaction.should_receive(:current).twice.
+ and_return(current)
end
after do
- ActiveSupport::Notifications.instrument 'process_action.action_controller'
+ ActiveSupport::Notifications.
+ instrument 'process_action.action_controller'
end
-
end
-
end