Sha256: 0a562a7d873a2cfd296b1880925da723cc3d8ffce69641c203652adddbc93982

Contents?: true

Size: 803 Bytes

Versions: 29

Compression:

Stored size: 803 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
      expect(ActiveReport.model_name).to eq("ActiveReport")
    end
    it "should have ActiveModel naming conventions" do
      expect(ActiveReport.model_name.i18n_key).to eq(:active_report)
    end
  end

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

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
datagrid-1.6.1 spec/datagrid/active_model_spec.rb
datagrid-1.6.0 spec/datagrid/active_model_spec.rb
datagrid-1.5.9 spec/datagrid/active_model_spec.rb
datagrid-1.5.8 spec/datagrid/active_model_spec.rb
datagrid-1.5.7 spec/datagrid/active_model_spec.rb
datagrid-1.5.6 spec/datagrid/active_model_spec.rb
datagrid-1.5.5 spec/datagrid/active_model_spec.rb
datagrid-1.5.4 spec/datagrid/active_model_spec.rb
datagrid-1.5.3 spec/datagrid/active_model_spec.rb
datagrid-1.5.2 spec/datagrid/active_model_spec.rb
datagrid-1.5.1 spec/datagrid/active_model_spec.rb
datagrid-1.5.0 spec/datagrid/active_model_spec.rb
datagrid-1.4.4 spec/datagrid/active_model_spec.rb
datagrid-1.4.3 spec/datagrid/active_model_spec.rb
datagrid-1.4.2 spec/datagrid/active_model_spec.rb
datagrid-1.4.1 spec/datagrid/active_model_spec.rb
datagrid-1.4.0 spec/datagrid/active_model_spec.rb
datagrid-1.3.9 spec/datagrid/active_model_spec.rb
datagrid-1.3.7 spec/datagrid/active_model_spec.rb
datagrid-1.3.6 spec/datagrid/active_model_spec.rb