bug fix: update_table_data raise error at on_load

This commit is contained in:
ainame
2013-07-24 11:07:23 +09:00
parent 7b5e1e3c47
commit abc6e5f201
2 changed files with 18 additions and 0 deletions

View File

@@ -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

View File

@@ -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