Sha256: 0a7971683ff5adb71dccb1a4e41f3084ea5387537217688850bd7009c6ba5ac1

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

require "spec_helper"

describe "assign-inputs" do
  before(:all) do
    ParserSupport.parse_file("utilities/assign-inputs")
    @text_inputs_list = [
      "[type='password']",
      "[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: #f00")
      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: #0f0")
      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: #00f")
      end
    end
  end

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

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
bourbon-7.3.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-7.2.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-7.1.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-7.0.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-6.0.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.1.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.1 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.8 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.7 spec/bourbon/utilities/assign_inputs_spec.rb
doggystyle-0.1.0 spec/doggystyle/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.6 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.5 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.4 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.3 spec/bourbon/utilities/assign_inputs_spec.rb
bourbon-5.0.0.beta.2 spec/bourbon/utilities/assign_inputs_spec.rb