Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Commit

Permalink
Add activerecord to consent test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
xjunior committed Apr 30, 2021
1 parent 3d2fe36 commit 4422eb8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions consent.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ Gem::Specification.new do |spec|
end
spec.require_paths = ['lib']

spec.add_development_dependency 'activerecord', '>= 5'
spec.add_development_dependency 'bundler', '>= 1.17.3'
spec.add_development_dependency 'cancancan', '~> 1.15.0'
spec.add_development_dependency 'pry', '~> 0.14.1'
spec.add_development_dependency 'rake', '>= 12.3.3'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '~> 0.65.0'
spec.add_development_dependency 'sqlite3', '~> 1.4.2'
end
12 changes: 12 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@
require 'date'

SomeModel = Struct.new(:name, :created_at)
require 'active_record'

ActiveRecord::Base.establish_connection(
adapter: 'sqlite3',
database: File.join(__dir__, 'test.db')
)

RSpec.configure do |config|
config.around(:example) do |example|
ActiveRecord::Base.transaction(&example)
end
end

Consent.default_views[:no_access] = Consent::View.new('', 'No Access')
Consent.load_subjects! [File.join(__dir__, 'permissions')]

0 comments on commit 4422eb8

Please sign in to comment.