Sha256: 2c7c151dfe533cc435077a8bf564ac502d756c974d8850a368263d6dc97e3ea8

Contents?: true

Size: 611 Bytes

Versions: 6

Compression:

Stored size: 611 Bytes

Contents

describe "Back Row" do
  tests_row :back

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

  it "should pop subform on select" do
    form = FakeForm.new
    @row.instance_variable_set("@section", form)
    @row.object._on_select(nil, nil)
    form.controller.pop_subform_called.should == true
  end
end

class FakeForm
  def form
    self
  end

  def controller
    @controller ||= FakeControllerClass.new
  end
end

class FakeControllerClass
  attr_accessor :pop_subform_called
  def pop_subform
    self.pop_subform_called = true
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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