Sha256: 565451985d459b2fa20a984c0db7b57dd1de25df6baf16c50cbddb4d1f46f73e

Contents?: true

Size: 1.85 KB

Versions: 20

Compression:

Stored size: 1.85 KB

Contents

describe "ProMotion::TableScreen updating functionality" do
  tests PM::UpdateTestTableScreen

  before { UIView.setAnimationDuration 0.01 }

  it 'should update a single row in the table view' do
    table_screen = UpdateTestTableScreen.new
    table_screen.make_more_cells
    table_screen.update_table_data
    table_screen.change_cells

    table_screen.first_cell_title.should == "Cell 1"
    table_screen.second_cell_title.should == "Cell 2"

    table_screen.update_table_data(NSIndexPath.indexPathForRow(0, inSection:0))

    table_screen.first_cell_title.should == "Cell A"
    table_screen.second_cell_title.should == "Cell 2"
  end

  it 'should allow multiple formats of index paths to be passed' do
    table_screen = UpdateTestTableScreen.new
    table_screen.make_more_cells
    table_screen.update_table_data
    table_screen.change_cells

    # Single NSIndexPath
    Proc.new {
      table_screen.update_table_data(NSIndexPath.indexPathForRow(0, inSection:0))
    }.should.not.raise(StandardError)

    # Array of NSIndexPaths
    Proc.new {
      table_screen.update_table_data([NSIndexPath.indexPathForRow(0, inSection:0), NSIndexPath.indexPathForRow(1, inSection:0)])
    }.should.not.raise(StandardError)

    # # Hash with single NSIndexPath
    Proc.new {
      table_screen.update_table_data({index_paths: NSIndexPath.indexPathForRow(0, inSection:0)})
    }.should.not.raise(StandardError)

    # Hash with array of NSIndexPaths
    Proc.new {
      table_screen.update_table_data({index_paths: [NSIndexPath.indexPathForRow(0, inSection:0), NSIndexPath.indexPathForRow(1, inSection:0)]})
    }.should.not.raise(StandardError)

    # Hash with NSIndexPath and row animation
    Proc.new {
      table_screen.update_table_data({index_paths: NSIndexPath.indexPathForRow(0, inSection:0), animation: UITableViewRowAnimationFade})
    }.should.not.raise(StandardError)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ProMotion-3.0.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.8.2 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.8.1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.8.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.7.1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.7.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.6.1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.6.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.5.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.5.0.beta1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.4.2 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.4.1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.4.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.3.1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.3.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.2.2 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.2.1 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.2.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.1.0 spec/functional/func_table_screen_updating_spec.rb
ProMotion-2.1.0.beta1 spec/functional/func_table_screen_updating_spec.rb