Skip to content

Commit

Permalink
Update to support latest bugfix updates to searchable table extension…
Browse files Browse the repository at this point in the history
… in ProMotion.
  • Loading branch information
andrewhavens committed Apr 17, 2018
1 parent 775b675 commit b0745dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/project/pro_motion/table.rb
Expand Up @@ -15,7 +15,7 @@ def set_up_searchable
if self.is_a?(ProMotion::DataTableScreen)
self.make_data_table_searchable(content_controller: self, search_bar: self.class.get_searchable_params)
else
self.make_searchable(self.class.get_searchable_params)
self.make_searchable
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion redpotion.gemspec
Expand Up @@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
spec.executables << 'potion'

spec.add_runtime_dependency "ruby_motion_query", ">= 1.7.0"
spec.add_runtime_dependency "ProMotion", ">= 2.7.0"
spec.add_runtime_dependency "ProMotion", ">= 2.7.1"
spec.add_runtime_dependency "motion_print"
spec.add_runtime_dependency "motion-cocoapods"
spec.add_runtime_dependency "RedAlert"
Expand Down
28 changes: 7 additions & 21 deletions spec/pro_motion/data_table_screen_spec.rb
Expand Up @@ -214,30 +214,16 @@ class << self
@controller.tableView.delegate.search_delegate.class.should == DataTableSeachDelegate
end

it "should create a search header" do
@controller.tableView.tableHeaderView.should.be.kind_of UISearchBar
end

it "should not hide the search bar initally by default" do
@controller.tableView.contentOffset.should == CGPointMake(0,0)
end
if UIDevice.currentDevice.systemVersion.to_f < 11.0
it "should create a search header" do
@controller.tableView.tableHeaderView.should.be.kind_of UISearchBar
end

it "should toggle searching?" do
@controller.searching?.should == false
@controller.search_delegate.willPresentSearchController(@controller.search_controller)
@controller.searching?.should == true
it "should not hide the search bar initally by default" do
@controller.tableView.contentOffset.should == CGPointMake(0,0)
end
end

# FIXME
# it "should store the search_string" do
# @controller.search_delegate.willPresentSearchController(@controller.search_controller)
# @controller.search_controller.searchBar.text = "ma"
# @controller.search_delegate.updateSearchResultsForSearchController(@controller.search_controller)
# @controller.search_string.should == "ma"
# @controller.search_delegate.willDismissSearchController(@controller.search_controller)
# @controller.search_string.should.be.nil
# end

it "should have a delegate object that isn't ProMotion" do
@controller.search_delegate.class.should.not == @controller.class
@controller.search_delegate.is_a?(DataTableSeachDelegate).should == true
Expand Down

0 comments on commit b0745dc

Please sign in to comment.