require 'spec_helper' describe BootstrapFlashHelper do describe "bootstrap_flash" do it "should return flash message" do stub!(:flash).and_return({:warning => "Update Warning!"}) bootstrap_flash.should == "
×Update Warning!
" end it "should return alert-success message when using notice message" do stub!(:flash).and_return({:notice => "Update Success!"}) bootstrap_flash.should == "
×Update Success!
" end it "should return alert-error message when using notice error" do stub!(:flash).and_return({:error => "Update Failed!"}) bootstrap_flash.should == "
×Update Failed!
" end it "should return alert-error message when using alert message" do stub!(:flash).and_return({:alert => "Update Alert!"}) bootstrap_flash.should == "
×Update Alert!
" end it "should return alert-info message when using info message" do stub!(:flash).and_return({:info => "Update Information!"}) bootstrap_flash.should == "
×Update Information!
" end it "should return no message when using an undefined message" do stub!(:flash).and_return({:undefined => "Update Undefined!"}) bootstrap_flash.should == "" end it "should return no message when the message is blank" do stub!(:flash).and_return({:notice => ""}) bootstrap_flash.should == "" end end end