Sha256: df79fb69dd77d56ca023d89525c6f29889eadaf5842b69397a4cac65363b2665

Contents?: true

Size: 884 Bytes

Versions: 6

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'

describe Codeqa::Checkers::CheckLinkto do
  it_behaves_like 'a checker'

  it 'should check erb files' do
    source = source_with('', 'file.html.erb')
    expect(described_class.check?(source)).to be_truthy
    source = source_with('', 'zipped.zip')
    expect(described_class.check?(source)).to be_falsey
  end

  it 'should detect <% link_to ... do ... %>' do
    source = source_with("<% link_to '/page',do_some_paths do%>", 'file.html.erb')
    checker = check_with(described_class, source)
    expect(checker).to be_error
    expect(checker.errors.details).to eq([
      [[1, 1], 'old style block link_to in line 1']
    ])
  end

  it 'should find not find if not there ' do
    source = source_with("<%= link_to '/page',do_some_paths do%>", 'file.html.erb')
    checker = check_with(described_class, source)
    expect(checker).to be_success
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
codeqa-0.5.0 spec/lib/codeqa/checkers/check_linkto_spec.rb
codeqa-0.4.2 spec/lib/codeqa/checkers/check_linkto_spec.rb
codeqa-0.4.1 spec/lib/codeqa/checkers/check_linkto_spec.rb
codeqa-0.4.0 spec/lib/codeqa/checkers/check_linkto_spec.rb
codeqa-0.4.0.pre2 spec/lib/codeqa/checkers/check_linkto_spec.rb
codeqa-0.4.0.pre spec/lib/codeqa/checkers/check_linkto_spec.rb