Sha256: 3c23c6d81721591a81f183e38348c05b02b585d0d7eadf0fc2465cfc05b8d7c8

Contents?: true

Size: 1016 Bytes

Versions: 13

Compression:

Stored size: 1016 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Blacklight do
  
  context "locate_path" do
    
    it "should find app/controllers/application_controller.rb" do
      result = Blacklight.locate_path 'app', 'controllers', 'application_controller.rb'
      result.should_not == nil
    end
    
    it "should not find blah.rb" do
      result = Blacklight.locate_path 'blah.rb'
      result.should == nil
    end
    
  end
  
  context 'root' do

    before(:all) do
      @blroot = File.expand_path(File.join(__FILE__, '..', '..', '..' ))
    end

    it 'should return the full path to the BL plugin' do
      Blacklight.root.should == @blroot
    end
    
    it 'should return the full path to the model directory' do
      Blacklight.models_dir.should == @blroot + "/app/models"
    end

    it 'should return the full path to the controllers directory' do
      Blacklight.controllers_dir.should == @blroot + "/app/controllers"
    end

  end
  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
blacklight-4.6.3 spec/lib/blacklight_spec.rb
blacklight-4.6.2 spec/lib/blacklight_spec.rb
blacklight-4.6.1 spec/lib/blacklight_spec.rb
blacklight-4.6.0 spec/lib/blacklight_spec.rb
blacklight-4.5.0 spec/lib/blacklight_spec.rb
blacklight-4.5.0.rc1 spec/lib/blacklight_spec.rb
blacklight-4.4.2 spec/lib/blacklight_spec.rb
blacklight-4.4.1 spec/lib/blacklight_spec.rb
blacklight-4.4.0 spec/lib/blacklight_spec.rb
blacklight-4.3.0 spec/lib/blacklight_spec.rb
blacklight-4.2.2 spec/lib/blacklight_spec.rb
blacklight-4.2.1 spec/lib/blacklight_spec.rb
blacklight-4.2.0 spec/lib/blacklight_spec.rb