Skip to content

Instantly share code, notes, and snippets.

View frostmark's full-sized avatar
🌊

markfrost frostmark

🌊
  • 🪐
  • 00:50 (UTC +04:00)
View GitHub Profile
@frostmark
frostmark / foo.md
Last active December 23, 2019 20:16
  • [X]
@frostmark
frostmark / policy_spec.rb
Last active August 16, 2017 20:26
testing modules in isolated
require 'rails_helper'
describe Policy do
let!(:user) { create :user }
let(:other_user) { create :user }
# создаем класс
class PolicyClass
# подключаем модуль который необходимо протестировать
include Policy
@frostmark
frostmark / answer.rb
Created August 16, 2017 20:13
testing modules in isolated
class Answer < ApplicationRecord
include Policy
belongs_to :question
belongs_to :user
validates :body, presence: true
end
@frostmark
frostmark / policy.rb
Created August 15, 2017 20:30
testing modules in isolation(medium)
module Policy
def can_destroy?(current_user)
user&.id == current_user.id
end
end
@frostmark
frostmark / settings.json
Created May 8, 2017 17:17
settings for vscode
{
"window.zoomLevel": 0,
"editor.fontSize": 13,
"editor.tabSize": 2,
"editor.wordWrap": "on",
"editor.minimap.maxColumn": 120,
"editor.wordWrapColumn": 100,
"editor.renderWhitespace": "all",
"workbench.colorTheme": "Monokai Dimmed",
"diffEditor.renderSideBySide": true,
@frostmark
frostmark / gulpfile.js
Last active September 27, 2016 09:52
Settings for gulp
'use strict';
var gulp = require('gulp'),
rigger = require('gulp-rigger'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
sourcemaps = require('gulp-sourcemaps'),