Sha256: 5eac702ed86eb1cae9038ef786d7172b48afcd1122c33b26a39524e8623ab2ca

Contents?: true

Size: 955 Bytes

Versions: 21

Compression:

Stored size: 955 Bytes

Contents

require 'configure_helper'
require 'cream/configure/rails'

Cream.available_roles = [:guest, :admin]

describe "Rails extension" do
  describe 'Extensions' 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
      end
      
      init_app_railties :minimal, :view
    end

    it "should extend Action Controller" do
      after_init :controller do
        :controller.should be_extended_with Cream, :role
        :controller.should be_extended_with Cream::Controller, :ability
        :controller.should be_extended_with Cream::Helper, :role, :host
      end            
      
      init_app_railties :minimal, :view
    end   
    
    it "should work with safe_concat" do
      "abc".html_safe.should == "abc"
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cream-0.7.5 spec/cream/configure/rails_custom_roles_spec.rb