Sha256: cf0c31f98d042d7cf1602bab44ea54c7c3c050447fbdef8470d0a6c0446daf8d

Contents?: true

Size: 1.5 KB

Versions: 40

Compression:

Stored size: 1.5 KB

Contents

require 'spec_helper'

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

    it { should report_lint line: 2 }
  end

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

    it { should_not report_lint }
  end

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

    it { should_not report_lint }
  end

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

    it { should report_lint line: 2 }
  end

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

    it { should_not report_lint }
  end

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

    it { should_not report_lint }
  end

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

    it { should_not report_lint }
  end
end

Version data entries

40 entries across 40 versions & 3 rubygems

Version Path
scss_lint-0.45.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.44.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.43.2 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.43.1 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.43.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.42.2 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.42.1 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.42.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.41.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.40.1 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.40.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.39.0 spec/scss_lint/linter/url_quotes_spec.rb
scss_lint-0.38.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.38.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-bliss-1.0.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.37.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.36.1 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.36.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.35.0 spec/scss_lint/linter/url_quotes_spec.rb
scss-lint-0.34.0 spec/scss_lint/linter/url_quotes_spec.rb