spec/unit/searchable_table_spec.rb in ProMotion-2.7.1 vs spec/unit/searchable_table_spec.rb in ProMotion-2.8.0

- old
+ new

@@ -16,11 +16,10 @@ controller.tableView(controller.tableView, numberOfRowsInSection:0).should == 50 end it "should allow searching for all the 'New' states" do controller.willPresentSearchController(controller.search_controller) - controller.searching?.should == true controller.search_controller.searchBar.text = "New" controller.updateSearchResultsForSearchController(controller.search_controller) controller.tableView(controller.tableView, numberOfRowsInSection:0).should == 4 end @@ -35,36 +34,19 @@ controller.updateSearchResultsForSearchController(controller.search_controller) # iOS calls this again controller.searching?.should == false controller.tableView(controller.tableView, numberOfRowsInSection:0).should == 50 end - it "should expose the search_string variable and clear it properly" do + it "should call the start and stop searching callbacks properly" do + controller.will_begin_search_called.should == nil + controller.will_end_search_called.should == nil + controller.willPresentSearchController(controller.search_controller) - controller.search_controller.searchBar.text = "North" - controller.updateSearchResultsForSearchController(controller.search_controller) + controller.will_begin_search_called.should == true - controller.search_string.should == "north" - controller.original_search_string.should == "North" - controller.willDismissSearchController(controller.search_controller) - controller.search_controller.searchBar.text = "" - controller.updateSearchResultsForSearchController(controller.search_controller) # iOS calls this again - - controller.search_string.should == false - controller.original_search_string.should == false + controller.will_end_search_called.should == true end - - # FIXME: Can't figure out why this test passes in isolation, but fails when run after the other tests. - # it "should call the start and stop searching callbacks properly" do - # controller.will_begin_search_called.should == nil - # controller.will_end_search_called.should == nil - - # controller.willPresentSearchController(controller.search_controller) - # controller.will_begin_search_called.should == true - - # controller.willDismissSearchController(controller.search_controller) - # controller.will_end_search_called.should == true - # end describe "custom search" do before do @stabby_controller = TableScreenStabbySearchable.new @proc_controller = TableScreenSymbolSearchable.new