Sha256: 97d25cfe52c3c8be2f6d2e753edc72f5b8d296c61118ebb19032018fe951ce52

Contents?: true

Size: 936 Bytes

Versions: 2

Compression:

Stored size: 936 Bytes

Contents

require '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'
      expect(result).not_to be_nil
    end
    
    it "should not find blah.rb" do
      result = Blacklight.locate_path 'blah.rb'
      expect(result).to be_nil
    end
    
  end
  
  context 'root' do

    let(:blroot) { File.expand_path(File.join(__FILE__, '..', '..', '..' )) }

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

    it 'should return the full path to the controllers directory' do
      expect(Blacklight.controllers_dir).to eq blroot + "/app/controllers"
    end

  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
blacklight-5.0.0.pre3 spec/lib/blacklight_spec.rb
blacklight-5.0.0.pre2 spec/lib/blacklight_spec.rb