spec/facemock/database/permission_spec.rb in facemock-0.0.6 vs spec/facemock/database/permission_spec.rb in facemock-0.0.7
- old
+ new
@@ -1,24 +1,34 @@
require 'spec_helper'
describe Facemock::Database::Permission do
- let(:table_name) { :permissions }
- let(:column_names) { [ :id, :name, :user_id, :created_at ] }
+ include TableHelper
- let(:id) { 1 }
- let(:name) { "read_stream" }
- let(:user_id) { 1 }
- let(:created_at) { Time.now }
- let(:options) { { id: id, name: name, user_id: user_id, created_at: created_at } }
+ let(:table_name) { :permissions }
+ let(:column_names) { [ :id, :name, :user_id, :created_at ] }
+ let(:children) { [] }
+ let(:id) { 1 }
+ let(:name) { "read_stream" }
+ let(:user_id) { 1 }
+ let(:created_at) { Time.now }
+ let(:options) { { id: id, name: name, user_id: user_id, created_at: created_at } }
+
+ after { remove_dynamically_defined_all_method }
+
describe '::TABLE_NAME' do
subject { Facemock::Database::Permission::TABLE_NAME }
it { is_expected.to eq table_name }
end
describe '::COLUMN_NAMES' do
subject { Facemock::Database::Permission::COLUMN_NAMES }
it { is_expected.to eq column_names }
+ end
+
+ describe '::CHILDREN' do
+ subject { Facemock::Database::Permission::CHILDREN }
+ it { is_expected.to eq children }
end
describe '#initialize' do
context 'without option' do
subject { Facemock::Database::Permission.new }