Sha256: ba8149d7f6fae1671b5ef79df0e7b79d4ff6ac3a8d54cca5eeba5650c2e96cdc

Contents?: true

Size: 783 Bytes

Versions: 25

Compression:

Stored size: 783 Bytes

Contents

require 'spec_helper'

describe Datagrid::ActiveModel do

  class ActiveReport
    include Datagrid::ActiveModel
  end

  module Grid
    class ActiveReport
      include Datagrid::ActiveModel
    end
  end

  describe ".model_name" do
    it "should be generate from class name " do
      ActiveReport.model_name.should == "ActiveReport"
    end
    it "should have ActiveModel naming conventions" do
      ActiveReport.model_name.i18n_key.should == :active_report
    end
  end

  describe ".param_name" do
    it "should make right param key from simple class name" do
      ActiveReport.param_name.should == 'active_report'
    end
    it "should make right param key from class of module" do
      Grid::ActiveReport.param_name.should == 'grid_active_report'
    end
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
datagrid-1.2.0 spec/datagrid/active_model_spec.rb
datagrid-1.1.2 spec/datagrid/active_model_spec.rb
datagrid-1.1.1 spec/datagrid/active_model_spec.rb
datagrid-1.1.0 spec/datagrid/active_model_spec.rb
datagrid-1.0.5 spec/datagrid/active_model_spec.rb
datagrid-1.0.4 spec/datagrid/active_model_spec.rb
datagrid-1.0.3 spec/datagrid/active_model_spec.rb
datagrid-1.0.2 spec/datagrid/active_model_spec.rb
datagrid-1.0.1 spec/datagrid/active_model_spec.rb
datagrid-1.0.0 spec/datagrid/active_model_spec.rb
datagrid-0.9.3 spec/datagrid/active_model_spec.rb
datagrid-0.9.2 spec/datagrid/active_model_spec.rb
datagrid-0.9.0 spec/datagrid/active_model_spec.rb
datagrid-0.8.4 spec/datagrid/active_model_spec.rb
datagrid-0.8.3 spec/datagrid/active_model_spec.rb
datagrid-0.8.2 spec/datagrid/active_model_spec.rb
datagrid-0.8.1 spec/datagrid/active_model_spec.rb
datagrid-0.8.0 spec/datagrid/active_model_spec.rb
datagrid-0.7.1 spec/datagrid/active_model_spec.rb
datagrid-0.7.0 spec/datagrid/active_model_spec.rb