Sha256: c26d4dc0adb5b02d95aadabbbe926501561b9a15082ddbffcc543c9d9c137638

Contents?: true

Size: 622 Bytes

Versions: 14

Compression:

Stored size: 622 Bytes

Contents

require 'spec_helper'

describe Hydra::AccessControlsEvaluation do
  
  describe "editor?" do
    it "should return false if the session[:user] is not logged in" do
      controller.stub(:current_user).and_return(nil)
      helper.editor?.should be_false
    end    
    it "should return false if the session[:user] does not have an editor role" do
      mock_user = mock("User")
      mock_user.stub(:email).and_return "nobody_special@example.com"
      mock_user.stub(:new_record?).and_return(false)
      controller.stub(:current_user).and_return(mock_user)
      helper.editor?.should be_false
    end
  end  
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
hydra-file-access-5.0.0.pre15 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre14 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre13 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre12 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre11 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre10 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre9 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre8 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre7 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre6 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre4 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre3 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre2 spec/helpers/access_controls_evaluation_spec.rb
hydra-file-access-5.0.0.pre1 spec/helpers/access_controls_evaluation_spec.rb