spec/unit/tables/table_screen_spec.rb in ProMotion-2.2.2 vs spec/unit/tables/table_screen_spec.rb in ProMotion-2.3.0
- old
+ new
@@ -78,9 +78,22 @@
it "should create a search header" do
@screen.tableView.tableHeaderView.should.be.kind_of UISearchBar
end
+ it "should not hide the search bar initally by default" do
+ @screen.tableView.contentOffset.should == CGPointMake(0,0)
+ end
+
+ it "should allow hiding the search bar initally" do
+ class HiddenSearchScreen < TableScreenSearchable
+ searchable hide_initially: true
+ end
+ screen = HiddenSearchScreen.new
+ screen.on_load
+ screen.tableView.contentOffset.should == CGPointMake(0,screen.searchDisplayController.searchBar.frame.size.height)
+ end
+
end
describe "refresh functionality" do
# Note this test only works if on iOS 6+ or when using CKRefreshControl.