Sha256: 017dbcd0a55b8863b867fa8d3039d5418e46bf54f968d9062d169733c74d4e84

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

require 'rubygems'
require 'bundler'
Bundler.setup

require 'sequel'
require 'sequel_secure_password'

adapter = RUBY_PLATFORM == "java" ? 'jdbc:sqlite::memory:' : 'sqlite:/'

RSpec.configure do |c|
  c.before :suite do
    Sequel::Model.plugin(:schema)
    Sequel.connect adapter

    class User < Sequel::Model
      set_schema do
        primary_key :id
        varchar     :password_digest
      end

      plugin :secure_password
    end

    class HighCostUser < Sequel::Model
      set_schema do
        primary_key :id
        varchar     :password_digest
      end

      plugin :secure_password, cost: 12
    end

    class UserWithoutValidations < Sequel::Model
      set_schema do
        primary_key :id
        varchar     :password_digest
      end

      plugin :secure_password, include_validations: false
    end

    User.create_table!
    HighCostUser.create_table!
    UserWithoutValidations.create_table!
  end

  c.around :each do |example|
    Sequel::Model.db.transaction(:rollback => :always) { example.run }
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sequel_secure_password-0.2.10 spec/spec_helper.rb
sequel_secure_password-0.2.8 spec/spec_helper.rb