mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-05-25 01:31:37 +08:00
bug fix: update_table_data raise error at on_load
This commit is contained in:
@@ -60,6 +60,7 @@ module ProMotion
|
||||
end
|
||||
|
||||
def update_table_view_data(data)
|
||||
create_table_view_from_data(data) unless @promotion_table_data
|
||||
@promotion_table_data.data = data
|
||||
table_view.reloadData
|
||||
end
|
||||
|
||||
@@ -95,4 +95,21 @@ describe "table screens" do
|
||||
|
||||
end
|
||||
|
||||
describe 'test PM::TableScreen\'s method call order' do
|
||||
before do
|
||||
class MethodCallOrderTestTableScreen < PM::TableScreen
|
||||
def table_data; @table_data ||= []; end
|
||||
def on_load
|
||||
@table_data = [{cells: [ title: 'cell 1' ]}]
|
||||
update_table_data
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'should not raise error at load view' do
|
||||
proc { @screen = MethodCallOrderTestTableScreen.new }.should.not.raise(NoMethodError)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user