Sha256: b49272981f51f589224dfb19120ccce85098a08c106e7e380ea5f290245d50ab

Contents?: true

Size: 915 Bytes

Versions: 5

Compression:

Stored size: 915 Bytes

Contents

require "spec_helper"
require 'sections_rails/view_finder'


describe "SectionsRails::ViewFinder" do

  describe '#find_all_views' do
    let(:result) { SectionsRails::ViewFinder.find_all_views 'spec/sections_rails/view_finder_spec' }
    let(:empty_result) { SectionsRails::ViewFinder.find_all_views 'spec/sections_rails/view_finder_spec/empty' }

    it 'returns all erb views' do
      expect(result).to include 'spec/sections_rails/view_finder_spec/erb/_erb.html.erb'
    end

    it 'returns all haml views' do
      expect(result).to include 'spec/sections_rails/view_finder_spec/haml/_haml.html.haml'
    end

    it 'returns views that are deeper nested in the directory structure' do
      expect(result).to include 'spec/sections_rails/view_finder_spec/nested/deeper/nested.html.erb'
    end

    it 'returns an empty array if there are no views' do
      expect(empty_result).to eq []
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sections_rails-0.10.0 spec/sections_rails/view_finder_spec.rb
sections_rails-0.9.0 spec/sections_rails/view_finder_spec.rb
sections_rails-0.8.1 spec/sections_rails/view_finder_spec.rb
sections_rails-0.8.0 spec/sections_rails/view_finder_spec.rb
sections_rails-0.7.2 spec/sections_rails/view_finder_spec.rb