Sha256: e8dee9c483c755ee2f633a5b4a347367bbf9cec7123f455b2aad1963b39e106b

Contents?: true

Size: 843 Bytes

Versions: 1

Compression:

Stored size: 843 Bytes

Contents

require 'configure_helper'

class Role  
  attr_accessor :name
  
  def initialize name
    self.name = name
  end
  
  def self.all
    [Role.new('admin'), Role.new('guest')]
  end
end

require 'cream/role'
require 'cream/configure'

describe "Rails extension" do
  describe 'View extension' do
    it "should extend Action View with Roles helper instance_methods and specific role methods" do
      after_init :view do
        :view.should be_extended_with Cream::View,    :role, :host, :user_action_menu
        :view.should be_extended_with Cream::Helper,  :role
        # [:admin, :guest].each do |role|
        #   view.should respond_to? :"for_#{role}"
        #   view.should respond_to? :"#{role}_area"
        #   view.should respond_to? :"#{role}?"
        # end
      end

      init_app_railties :minimal, :view
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cream-0.5.8 spec/cream/configure/rails_spec.rb