Sha256: 895a0cd79ec062f123a7a19ac1d698983a0f3506773d4dcacea3c1cd4beeb972

Contents?: true

Size: 610 Bytes

Versions: 10

Compression:

Stored size: 610 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

10 entries across 10 versions & 1 rubygems

Version Path
formotion-1.3.1 spec/row_type/back_spec.rb
formotion-1.3 spec/row_type/back_spec.rb
formotion-1.2 spec/row_type/back_spec.rb
formotion-1.1.5 spec/row_type/back_spec.rb
formotion-1.1.4 spec/row_type/back_spec.rb
formotion-1.1.3 spec/row_type/back_spec.rb
formotion-1.1.2 spec/row_type/back_spec.rb
formotion-1.1.1 spec/row_type/back_spec.rb
formotion-1.1 spec/row_type/back_spec.rb
formotion-1.0 spec/row_type/back_spec.rb