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

Version Path
simple_auth-1.5.0 spec/simple_auth/helper_spec.rb
simple_auth-1.4.5 spec/simple_auth/helper_spec.rb
simple_auth-1.4.4 spec/simple_auth/helper_spec.rb
simple_auth-1.4.3 spec/simple_auth/helper_spec.rb
simple_auth-1.4.2 spec/simple_auth/helper_spec.rb
simple_auth-1.4.1 spec/simple_auth/helper_spec.rb
simple_auth-1.4.0 spec/simple_auth/helper_spec.rb
simple_auth-1.3.3 spec/simple_auth/helper_spec.rb
simple_auth-1.3.2 spec/simple_auth/helper_spec.rb
simple_auth-1.3.1 spec/simple_auth/helper_spec.rb
simple_auth-1.3.0 spec/simple_auth/helper_spec.rb
simple_auth-1.2.0 spec/simple_auth/helper_spec.rb
simple_auth-1.1.0 spec/simple_auth/helper_spec.rb
simple_auth-1.0.2 spec/simple_auth/helper_spec.rb
simple_auth-1.0.1 spec/simple_auth/helper_spec.rb