Sha256: ce4e216c1c5d66151f65a0f380cc91d8920a50366ffc23cb842a5be2d7800226

Contents?: true

Size: 756 Bytes

Versions: 21

Compression:

Stored size: 756 Bytes

Contents

require "spec_helper"

describe AwesomeTranslations::ErbInspector::FileInspector do
  let(:erb_inspector) do
    AwesomeTranslations::ErbInspector.new(
      dirs: [Rails.root.to_s]
    )
  end

  let(:files) { erb_inspector.files.to_a }
  let(:file_paths) { files.map(&:file_path) }
  let(:user_index_inspector) { files.find { |file_inspector| file_inspector.file_path == "app/views/users/index.html.haml" } }
  let(:user_index_translations) { user_index_inspector.translations.to_a }
  let(:hello_world_translation) { user_index_translations.find { |translation| translation.key == ".hello_world" } }

  describe "#translations" do
    it "finds the right number of translations" do
      expect(user_index_translations.length).to eq 3
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
awesome_translations-0.0.46 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.45 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.44 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.43 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.42 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.41 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.40 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.39 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.38 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.37 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.36 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.35 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.34 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.33 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.32 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.31 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.30 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.29 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.28 spec/lib/erb_inspector/file_inspector_spec.rb
awesome_translations-0.0.27 spec/lib/erb_inspector/file_inspector_spec.rb