Sha256: 4083ee3cf15c88061a2afd21c9c8df869753765a43db013cc80d10cf6f27e9b7

Contents?: true

Size: 1.19 KB

Versions: 21

Compression:

Stored size: 1.19 KB

Contents

require "spec_helper"

describe "assign-inputs" do
  before(:all) do
    ParserSupport.parse_file("functions/assign-inputs")
    @text_inputs_list = [
      "input[type=\"password\"]",
      "input[type=\"text\"]",
      "textarea"
    ]
  end

  context "expands plain text inputs" do
    it "finds selectors" do
      @text_inputs_list.each do |input|
        expect(input).to have_rule("color: #ff0000")
      end
    end
  end

  context "expands text inputs with pseudo classes" do
    it "finds selectors" do
      list = @text_inputs_list.dup
      list.map! { |input| input + ":active" }
      list.each do |input|
        expect(input).to have_rule("color: #00ff00")
      end
    end
  end

  context "expands text inputs when first in list" do
    it "finds selectors" do
      list = @text_inputs_list.dup
      list.push "select"
      list.each do |input|
        expect(input).to have_rule("color: #0000ff")
      end
    end
  end

  context "expands text inputs when middle of list" do
    it "finds selectors" do
      list = @text_inputs_list.dup
      list.unshift "input[type=\"file\"]"
      list.each do |input|
        expect(input).to have_rule("color: #ff00ff")
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
bourbon-4.3.4 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.3.3 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.3.2 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.3.1 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.3.0 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.7 spec/bourbon/functions/assign_inputs_spec.rb
styler-sass-0.1.8.alpha spec/bourbon/functions/assign_inputs_spec.rb
styler-sass-0.1.7 spec/bourbon/functions/assign_inputs_spec.rb
styler-sass-0.1.7.alpha spec/bourbon/functions/assign_inputs_spec.rb
styler-sass-0.1.5.alpha spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.6 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.5 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.4 spec/bourbon/functions/assign_inputs_spec.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/bourbon-4.2.3/spec/bourbon/functions/assign_inputs_spec.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/bourbon-4.2.3/spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.3 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.2 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.1 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.0 spec/bourbon/functions/assign_inputs_spec.rb
bourbon-4.2.0.beta spec/bourbon/functions/assign_inputs_spec.rb