Skip to content

Commit

Permalink
Merge pull request #241 from ryanfox1985/development
Browse files Browse the repository at this point in the history
I don't know why fail.
  • Loading branch information
leikind committed Jul 16, 2015
2 parents ca64889 + 1333134 commit 581ee30
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ActiveRecord::Schema.define(version: 20150713103513) do
create_table "dummies", force: :cascade do |t|
t.string "name"

t.datetime "created_at"
t.datetime "updated_at"
end
end
3 changes: 3 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
SimpleCov.start

begin
require 'support/active_record'
require 'action_controller'
require 'action_view'
rescue LoadError
Expand All @@ -41,6 +42,8 @@
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
require 'wice_grid'

ActiveRecord::ConnectionAdapters::Column.send(:include, ::Wice::WiceGridExtentionToActiveRecordColumn)
ActiveRecord::Base.send(:include, ::Wice::MergeConditions)

RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
Expand Down
10 changes: 10 additions & 0 deletions spec/support/active_record.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'active_record'

ActiveRecord::Base.establish_connection adapter: 'sqlite3', database: ':memory:'

load 'spec/schema.rb'

class Dummy < ActiveRecord::Base
end

Dummy.create(name: 'test')
24 changes: 24 additions & 0 deletions spec/wice/lib/table_column_matrix_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# encoding: utf-8
module Wice
describe TableColumnMatrix do
GENERAL_CONDITIONS = 'conditions'

it 'should new' do
table = TableColumnMatrix.new

expect(table.class).to eq(TableColumnMatrix)
end

it 'should add_condition' do
table = TableColumnMatrix.new
table.add_condition('key', GENERAL_CONDITIONS)

expect(table.conditions).to include(GENERAL_CONDITIONS)
end

it 'should set default_model_class' do
table = TableColumnMatrix.new
table.default_model_class = Dummy
end
end
end
2 changes: 2 additions & 0 deletions wice_grid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.date = '2015-08-14'

s.add_dependency 'activerecord', ['~> 4.2']
s.add_dependency 'kaminari', ['~> 0.16']
s.add_dependency 'coffee-rails', ['~> 4.0']
s.add_dependency 'font-awesome-sass', ['~> 4.3']
Expand All @@ -27,4 +28,5 @@ Gem::Specification.new do |s|
s.add_development_dependency('rubocop', '~> 0.32')
s.add_development_dependency('coveralls', '~> 0.8.2')
s.add_development_dependency('codeclimate-test-reporter', '~> 0.4.7')
s.add_development_dependency('sqlite3', '~> 1.3')
end

0 comments on commit 581ee30

Please sign in to comment.