Sha256: 8e6cfaa91f496c7c7eefbddf1a0b3932893d6c3d8787a1bd1df80c5b095ef8e6

Contents?: true

Size: 573 Bytes

Versions: 3

Compression:

Stored size: 573 Bytes

Contents

require 'spec_helper'

describe Tableficate::Filter::Choice do
  it 'should mark a choice as selected if it has a :selected or :checked option' do
    choice = Tableficate::Filter::Choice.new('foo', 'bar', {selected: 'selected'})
    choice.selected?.should be true
    choice.attrs[:selected].should be nil

    choice = Tableficate::Filter::Choice.new('foo', 'bar')
    choice.selected?.should be false

    choice = Tableficate::Filter::Choice.new('foo', 'bar', {checked: 'checked'})
    choice.checked?.should be true
    choice.attrs[:checked].should be nil
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tableficate-0.3.2 spec/filters/choice_spec.rb
tableficate-0.3.1 spec/filters/choice_spec.rb
tableficate-0.3.0 spec/filters/choice_spec.rb