forked from spree/spree
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restore alert checking functionality, specs to make sure
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Spree's rpsec controller tests get the Spree::ControllerHacks | ||
# we don't need those for the anonymous controller here, so | ||
# we call process directly instead of get | ||
require 'spec_helper' | ||
|
||
describe Spree::Admin::BaseController do | ||
|
||
controller(Spree::Admin::BaseController) do | ||
def index | ||
render :text => 'test' | ||
end | ||
end | ||
|
||
before do | ||
controller.stub :current_user => Factory(:admin_user) | ||
end | ||
|
||
describe "check alerts" do | ||
it "checks alerts with before_filter" do | ||
controller.should_receive :check_alerts | ||
process :index | ||
end | ||
|
||
it "saves alerts into session" do | ||
Spree::Alert.should_receive(:current).and_return([Spree::Alert.new(:message => "test alert", :severity => 'release')]) | ||
process :index | ||
session[:alerts].first.message.should eq "test alert" | ||
end | ||
end | ||
end |