Sha256: f78ad68352ffa5bd2bdf68d2f6a9fd2be80720b8c056cc40daeda86b1be1ae28

Contents?: true

Size: 1.16 KB

Versions: 27

Compression:

Stored size: 1.16 KB

Contents

# More or less complete

require File.dirname(__FILE__) + '/test_helper.rb'
require 'action_controller/test_process'

class WiceGridMiscTest < Test::Unit::TestCase
  
  
  def test_get_query_store_model
    assert_equal(SavedQuery, Wice.get_query_store_model)
  end

  class InvalidQueryStorageModel
  end
  class InvalidQueryStorageModel2
    def self.list
    end
  end
  class InvalidQueryStorageModel3
    def self.list(a,b,c)
    end
  end
  class ValidQueryStorageModel
    def self.list(a,b)
    end
  end

  def test_validate_query_model
    assert_raise(Wice::WiceGridArgumentError){Wice.validate_query_model(InvalidQueryStorageModel)}
    assert_raise(Wice::WiceGridArgumentError){Wice.validate_query_model(InvalidQueryStorageModel2)}
    assert_raise(Wice::WiceGridArgumentError){Wice.validate_query_model(InvalidQueryStorageModel3)}
    assert_nothing_raised{Wice.validate_query_model(ValidQueryStorageModel)}
    assert_equal(true, Wice.validate_query_model(ValidQueryStorageModel))
  end

  def test_deprecated_call
    opts = {:foo => :baz, :old_name => 23}
    Wice.deprecated_call(:old_name, :new_name, opts)
    assert_equal({:foo => :baz, :new_name => 23} , opts)
  end
end

Version data entries

27 entries across 27 versions & 4 rubygems

Version Path
wice_grid_mongo-6.2.4 test/wice_grid_misc_test.rb
wice_grid-3.0.4 test/wice_grid_misc_test.rb
wice_grid-3.0.3 test/wice_grid_misc_test.rb
wice_grid-3.0.2 test/wice_grid_misc_test.rb
wice_grid-3.0.1 test/wice_grid_misc_test.rb
wice_grid-3.0.0 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.2.3 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.2.2 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.2.1 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.2.0 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.1.1 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.1.0 test/wice_grid_misc_test.rb
wice_grid-3.0.0.pre4 test/wice_grid_misc_test.rb
wice_grid-3.0.0.pre3 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.0.10 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.0.9 test/wice_grid_misc_test.rb
wice_grid-3.0.0.pre2 test/wice_grid_misc_test.rb
wice_grid-3.0.0.pre1 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.0.8 test/wice_grid_misc_test.rb
wice_grid_mongoid-6.0.7 test/wice_grid_misc_test.rb