mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-09 19:09:00 -05:00
Use fixed time for start_at and end_at in suggest_spec.rb
This commit is contained in:
@@ -1 +1 @@
|
||||
0.15.6
|
||||
0.15.7
|
||||
|
||||
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# 0.15.7 - 2024-10-19
|
||||
|
||||
### Fixed
|
||||
|
||||
- A bug where "RuntimeError: failed to get urandom" was being raised upon importing attempt on Synology.
|
||||
|
||||
# 0.15.6 - 2024-10-19
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
# -*- coding: us-ascii -*-
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This code fixes failed to get urandom for running Ruby on Docker for Synology.
|
||||
class Random
|
||||
|
||||
class << self
|
||||
|
||||
private
|
||||
|
||||
|
||||
# :stopdoc:
|
||||
|
||||
# Implementation using OpenSSL
|
||||
def gen_random_openssl(n)
|
||||
return OpenSSL::Random.random_bytes(n)
|
||||
OpenSSL::Random.random_bytes(n)
|
||||
end
|
||||
|
||||
begin
|
||||
@@ -21,7 +19,7 @@ class Random
|
||||
begin
|
||||
require 'openssl'
|
||||
rescue NoMethodError
|
||||
raise NotImplementedError, "No random device"
|
||||
raise NotImplementedError, 'No random device'
|
||||
else
|
||||
alias urandom gen_random_openssl
|
||||
end
|
||||
|
||||
@@ -5,8 +5,8 @@ require 'rails_helper'
|
||||
RSpec.describe Visits::Suggest do
|
||||
describe '#call' do
|
||||
let!(:user) { create(:user) }
|
||||
let(:start_at) { 1.week.ago }
|
||||
let(:end_at) { Time.current }
|
||||
let(:start_at) { Time.new(2020, 1, 1, 0, 0, 0) }
|
||||
let(:end_at) { Time.new(2020, 1, 1, 2, 0, 0) }
|
||||
|
||||
let!(:points) do
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user