Sha256: 11b5587a482e348d070ae908af3d825e7d7724e32ad2c49798969b8710974d19

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

RSpec.describe 'SvgHeartsYou for Rails:', type: :feature do

  let(:test_svg_path) { 'some/junk/path/svgs' }

  describe 'configuration' do
    describe 'paths searched' do
      # Singleton module is messy for random order tests, so wipe state after each
      after(:each) do
        SvgHeartsYou.reset
      end

      it 'includes rails assets path' do
        expect(SvgHeartsYou.configuration.all_svg_paths.length).to be > 0
      end

      it 'uses internal svg_paths before rails assets paths' do
        SvgHeartsYou.configure do |config|
          config.svg_paths << test_svg_path
        end

        expect(SvgHeartsYou.configuration.all_svg_paths[0]).to be(test_svg_path)
      end
    end
  end

  describe 'basic use of helper methods' do
    before do
      visit '/basic'
    end

    it '#svg_inline' do
      expect(page).to have_selector('path')
    end

    it '#svg_symbol' do
      expect(page).to have_selector('symbol', visible: false)
    end

    it '#svg_use' do
      expect(page).to have_selector('use')
    end
  end

  describe 'use of folder and blocks in helper methods' do
    before do
      visit '/folder'
    end

    it 'symbolizes folders' do
      expect(page).to have_css('svg>symbol', visible: false, minimum: 8)
      # save_and_open_page
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
svg_hearts_you-0.0.2 spec/rails/features/rails_svg_spec.rb
svg_hearts_you-0.0.1 spec/rails/features/rails_svg_spec.rb