test/unit/grid_panel_test.rb in netzke-basepack-0.5.6 vs test/unit/grid_panel_test.rb in netzke-basepack-0.5.7

- old
+ new

@@ -2,20 +2,20 @@ require 'netzke-core' require 'netzke/plugins/configuration_tool' require 'netzke/accordion_panel' -require 'netzke/grid_panel_api' -require 'netzke/grid_panel_js' +require 'netzke/grid_panel/grid_panel_api' +require 'netzke/grid_panel/grid_panel_js' require 'netzke/grid_panel' require 'netzke/active_record/basepack' class GridPanelTest < ActiveSupport::TestCase test "api" do - grid = Netzke::GridPanel.new(:name => 'grid', :data_class_name => 'Book', :columns => [:id, :title, :recent]) + grid = Netzke::GridPanel.new(:name => 'grid', :model => 'Book', :columns => [:id, :title, :recent]) # post res = grid.post_data("created_records" => [{:title => 'Lord of the Rings'}].to_nifty_json) assert_equal('Lord of the Rings', Book.first.title) @@ -34,10 +34,10 @@ assert_equal(nil, Book.first) end test "normalize index" do - grid = Netzke::GridPanel.new(:name => 'grid', :data_class_name => 'Book', :columns => [:id, :col0, {:name => :col1, :excluded => true}, :col2, {:name => :col3, :excluded => true}, :col4, :col5]) + grid = Netzke::GridPanel.new(:name => 'grid', :model => 'Book', :columns => [:id, :col0, {:name => :col1, :excluded => true}, :col2, {:name => :col3, :excluded => true}, :col4, :col5]) assert_equal(0, grid.normalize_index(0)) assert_equal(1, grid.normalize_index(1)) assert_equal(3, grid.normalize_index(2)) assert_equal(5, grid.normalize_index(3))