Sha256: 0c0fe2218cc21997573b6cd3e4851cf83cf1994dcf3ad4622608ccbcab89aeeb

Contents?: true

Size: 1.48 KB

Versions: 5

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

describe SCSSLint::Linter::UrlQuotes do
  context 'when property has a literal URL' do
    let(:css) { <<-CSS }
      p {
        background: url(example.png);
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when property has a URL enclosed in single quotes' do
    let(:css) { <<-CSS }
      p {
        background: url('example.png');
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a URL enclosed in double quotes' do
    let(:css) { <<-CSS }
      p {
        background: url("example.png");
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a literal URL in a list' do
    let(:css) { <<-CSS }
      p {
        background: transparent url(example.png);
      }
    CSS

    it { should report_lint line: 2 }
  end

  context 'when property has a single-quoted URL in a list' do
    let(:css) { <<-CSS }
      p {
        background: transparent url('example.png');
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a double-quoted URL in a list' do
    let(:css) { <<-CSS }
      p {
        background: transparent url("example.png");
      }
    CSS

    it { should_not report_lint }
  end

  context 'when property has a data URI' do
    let(:css) { <<-CSS }
      .tracking-pixel {
        background: url(data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==);
      }
    CSS

    it { should_not report_lint }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
scss-lint-0.33.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.32.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.31.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.30.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.29.0 spec/scss_lint/linter/url_quotes_spec.rb