Sha256: dc1b6d3772f5067dbe0d8c8a3ef806d2afcba0b1c8cce2698e91977e1589f83c

Contents?: true

Size: 1.11 KB

Versions: 5

Compression:

Stored size: 1.11 KB

Contents

describe "Text Row" do
  tests_row :text

  it "should initialize with correct settings" do
    @row.object.class.should == Formotion::RowType::TextRow
  end

  # Value
  it "should have no value by default" do
    cell = @row.make_cell
    @row.text_field.text.should == ''
  end

  it "should use custom value" do
    @row.value = 'init value'
    cell = @row.make_cell

    @row.text_field.text.should == 'init value'
  end

  it "should bind row.value" do
    @row.value = 'init value'
    cell = @row.make_cell

    @row.value = "new value"
    @row.text_field.text.should == 'new value'
  end

  it "should use custom font" do
    huge_non_default_font = UIFont.boldSystemFontOfSize(20)
    @row.font = huge_non_default_font
    cell = @row.make_cell
    @row.text_field.font.should == huge_non_default_font
  end

  # Placeholder
  it "should have no placeholder by default" do
    cell = @row.make_cell
    @row.text_field.placeholder.should == nil
  end

  it "should use custom placeholder" do
    @row.placeholder = 'placeholder'
    cell = @row.make_cell
    @row.text_field.placeholder.should == 'placeholder'
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
formotion-1.7 spec/row_type/text_spec.rb
formotion-1.6 spec/row_type/text_spec.rb
formotion-1.5.1 spec/row_type/text_spec.rb
formotion-1.5.0 spec/row_type/text_spec.rb
formotion-1.4.0 spec/row_type/text_spec.rb