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.9.2 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.9.1 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.9.0 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.9.3 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.9.2 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.9.1 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.9 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.8 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.7 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.6 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.5 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.4 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.3 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.2 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.1 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.8.0 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.7.10 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.7.8 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.7.7 spec/cream/configure/rails_custom_roles_spec.rb
cream-0.7.6 spec/cream/configure/rails_custom_roles_spec.rb