Sha256: 936caa57d0fc4bba40a6bcab87f0ac9326db3f0e9a14b5caca3f5fee7645dcaf

Contents?: true

Size: 826 Bytes

Versions: 10

Compression:

Stored size: 826 Bytes

Contents

require 'spec_helper'

describe UsersController, :type => :controller do

  it "should raise an error if the checked power is not given" do
    expect { get :update, :id => '1' }.to raise_error(Consul::Powerless)
  end

  it 'should allow to map actions to another power using the :map option' do
    expect { get :show, :id => '1' }.to_not raise_error
  end


  describe '.power_name_for_action' do

    it 'should return the name of the power for the given action (feature request from devolute)' do
      UsersController.power_name_for_action(:show).should == :always_true
      UsersController.power_name_for_action('show').should == :always_true
      UsersController.power_name_for_action(:update).should == :always_false
      UsersController.power_name_for_action('update').should == :always_false
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
consul-0.9.1 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.9.0 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.8.0 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.7.0 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.6.1 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.6.0 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.5.0 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.4.2 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.4.1 spec/shared/consul/controllers/users_controller_spec.rb
consul-0.4.0 spec/shared/controllers/users_controller_spec.rb