Sha256: 609091e58bd74f11666b1a22a7d54bdd71f38681a18183b811735dea8fe6996b
Contents?: true
Size: 704 Bytes
Versions: 15
Compression:
Stored size: 704 Bytes
Contents
require "spec_helper" describe SimpleAuth::Helper do before do @helper = Object.new @helper.class_eval { attr_accessor :output_buffer } @helper.extend(SimpleAuth::Helper) @helper.extend(ActionView::Helpers::CaptureHelper) end it "should include module" do ApplicationController.included_modules.include?(SimpleAuth::Helper) end it "should render block when user is logged" do @helper.should_receive(:logged_in?).and_return(true) @helper.when_logged { "logged" }.should == "logged" end it "should not render block when user is unlogged" do @helper.should_receive(:logged_in?).and_return(false) @helper.when_logged { "logged" }.should be_nil end end
Version data entries
15 entries across 15 versions & 1 rubygems