Sha256: ea91231a739da2171fa39d901cbbb92848e423311e03a05db3e4dd195f33f71f

Contents?: true

Size: 915 Bytes

Versions: 16

Compression:

Stored size: 915 Bytes

Contents

describe "Image Row" do
  tests_row :image do |row|
    row.instance_eval do
      def form
        @form ||= Object.new.tap do |o|
          def o.reload_data
            # do nothing for tests
          end
        end
      end
    end
  end

  it "should build cell with an image view" do
    cell = @row.make_cell
    image_view = cell.viewWithTag(Formotion::RowType::ImageRow::IMAGE_VIEW_TAG)
    image_view.nil?.should == false
    image_view.class.should == UIImageView
    image_view.image.nil?.should == true
    cell.accessoryView.class.should == UIButton
  end

  # Value
  it "should change row properties when row gets a value" do
    cell = @row.make_cell

    @row.value = UIImage.alloc.init

    @row.row_height.should > 44
    image_view = cell.viewWithTag(Formotion::RowType::ImageRow::IMAGE_VIEW_TAG)
    image_view.image.nil?.should == false
    cell.accessoryView.nil?.should == true
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
formotion-1.8 spec/row_type/image_spec.rb
formotion-1.7 spec/row_type/image_spec.rb
formotion-1.6 spec/row_type/image_spec.rb
formotion-1.5.1 spec/row_type/image_spec.rb
formotion-1.5.0 spec/row_type/image_spec.rb
formotion-1.4.0 spec/row_type/image_spec.rb
formotion-1.3.1 spec/row_type/image_spec.rb
formotion-1.3 spec/row_type/image_spec.rb
formotion-1.2 spec/row_type/image_spec.rb
formotion-1.1.5 spec/row_type/image_spec.rb
formotion-1.1.4 spec/row_type/image_spec.rb
formotion-1.1.3 spec/row_type/image_spec.rb
formotion-1.1.2 spec/row_type/image_spec.rb
formotion-1.1.1 spec/row_type/image_spec.rb
formotion-1.1 spec/row_type/image_spec.rb
formotion-1.0 spec/row_type/image_spec.rb