spec/unit/tables/table_screen_spec.rb in ProMotion-2.3.0 vs spec/unit/tables/table_screen_spec.rb in ProMotion-2.3.1

- old
+ new

@@ -61,9 +61,31 @@ screen.view.rowHeight.should == 77 screen.view.estimatedRowHeight.should == 77 end + it "sets up proper accessibility methods" do + class NoneditableTableScreen < PM::TableScreen + def on_load + end + + def table_data + [{ + title: "test", + cells: [{ title: "Non-editable test" }] + }] + end + end + + noneditable = NoneditableTableScreen.new + noneditable.on_load + noneditable.editable?.should==false + index_path = NSIndexPath.indexPathForRow(0, inSection: 0) + lambda { noneditable.tableView(noneditable, commitEditingStyle: UITableViewCellEditingStyleDelete, forRowAtIndexPath: index_path) }.should.raise NoMethodError + @screen.editable?.should == true + @screen.should.respond_to(:"tableView:commitEditingStyle:forRowAtIndexPath") + end + end describe "search functionality" do before do