Sha256: 4e2aadd5a795584adfb2e7fd477bfc1e4ec90adb951d6d9f3e35899ad101f0b0

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe "Simple Action for controllers" do
  
  it "should find a simple action" do
    simple_action = ExtremeSimpleAction.create :controller_name => 'users', :action_name => 'index'
    found_simple_action = ExtremeSimpleAction.find_action :action_name => simple_action.action_name, :controller_name => simple_action.controller_name
    found_simple_action.should_not be_nil
    #profile.has_permission?(simple_action).should be_true
  end
  
  it "should grant permission" do
    grant = FactoryGirl.create(:extreme_grant_for_simple_action)
    action = grant.action
    profile = grant.profile
    action.has_permission?(profile).should be_true
  end
  
  it "should not grant permission" do
    grant = FactoryGirl.create(:extreme_grant_for_simple_action)
    action = FactoryGirl.create :extreme_simple_action
    profile = FactoryGirl.create :extreme_profile
    action.has_permission?(profile).should be_false
  end
end


describe "Simple Action for helpers" do
   it "should find a simple action" do
     simple_action = FactoryGirl.create :extreme_simple_action_helper
     found_simple_action = ExtremeSimpleAction.find_action :helper_name => simple_action.helper_name, :method_name => simple_action.method_name
     found_simple_action.should_not be_nil
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
extreme_aas-0.0.2 spec/unit/simple_action_spec.rb
extreme_aas-0.0.1 spec/unit/simple_action_spec.rb