Skip to content

Instantly share code, notes, and snippets.

View avegancafe's full-sized avatar

Kyle Holzinger avegancafe

View GitHub Profile
@avegancafe
avegancafe / space_authority_lazy_load_evaluations_spec.rb
Last active May 17, 2020 18:36
Examples for RSpec Formatting Blog Post - space_authority_lazy_load_evaluations_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let(:user) { create(:user) }
let(:authorized_space_through_property) { create(:space, unit: 'authorized space through property', ...) }
let(:authorized_space_directly) { create(:space, unit: 'authorized space directly', ...) }
let(:unauthorized_space) { create(:space, unit: 'unauthorized space', ...) }
subject { described_class.new(user).authorized_spaces }
it 'only lists authorized spaces' do
expect(subject.map(&:unit)).to match_array([
@avegancafe
avegancafe / space_authority_eager_load_evaluations_spec.rb
Last active May 17, 2020 18:36
Examples for RSpec Formatting Blog Post - space_authority_eager_load_evaluations_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let(:user) { create(:user) }
let!(:authorized_space_through_property) { create(:space, unit: 'authorized space through property', ...) }
let!(:authorized_space_directly) { create(:space, unit: 'authorized space directly', ...) }
let!(:unauthorized_space) { create(:space, unit: 'unauthorized space', ...) }
subject { described_class.new(user).authorized_spaces }
it 'only lists authorized spaces' do
expect(subject.map(&:unit)).to match_array([
@avegancafe
avegancafe / space_authority_array_name_expectations_spec.rb
Last active May 18, 2020 16:01
Examples for RSpec Formatting Blog Post - space_authority_array_name_expectations_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let!(:authorized_space_through_property) { create(:space, suite: 'authorized space through property', ...) }
let!(:authorized_space_directly) { create(:space, suite: 'authorized space directly', ...) }
let!(:unauthorized_space) { create(:space, suite: 'unauthorized space', ...) }
subject { described_class.new(user).authorized_spaces }
it 'only lists authorized spaces' do
expect(subject.map(&:suite)).to match_array([
authorized_space_through_property,
@avegancafe
avegancafe / space_authority_array_id_expectations_spec.rb
Created May 5, 2020 18:51
Examples for RSpec Formatting Blog Post - space_authority_array_id_expectations_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let!(:authorized_space_through_property) { create(:space, ...) }
let!(:authorized_space_directly) { create(:space, ...) }
let!(:unauthorized_space) { create(:space, ...) }
subject { described_class.new(user).authorized_spaces }
it 'only lists authorized spaces' do
expect(subject.map(&:id).to match_array([
authorized_space_through_property.id,
@avegancafe
avegancafe / space_authority_array_expectations_spec.rb
Last active May 5, 2020 18:52
Examples for RSpec Formatting Blog Post - space_authority_array_expectations_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let!(:authorized_space_through_property) { create(:space, ...) }
let!(:authorized_space_directly) { create(:space, ...) }
let!(:unauthorized_space) { create(:space, ...) }
subject { described_class.new(user).authorized_spaces }
it 'only lists authorized spaces' do
expect(subject).to match_array([
authorized_space_through_property,
@avegancafe
avegancafe / space_authority_outcome_naming_spec.rb
Created May 5, 2020 18:34
Examples for RSpec Formatting Blog Post - space_authority_outcome_naming_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let!(:account) { create(:account) }
let!(:user) { create(:user) }
let!(:authorized_space) do
property = create(:property, primary_account: account, users: [user])
create(:space, property: property)
end
let!(:unauthorized_space) do
property = create(:property, primary_account: account)
@avegancafe
avegancafe / space_authority_numeral_naming_spec.rb
Last active May 5, 2020 18:34
Examples for RSpec Formatting Blog Post - space_authority_numeral_naming_spec.rb
describe SpaceAuthority do
describe '#authorized_spaces' do
let!(:account) { create(:account) }
let!(:user) { create(:user) }
let!(:property_1) { create(:property, primary_account: account, users: [user]) }
let!(:property_2) { create(:property) }
let!(:floor_1) { create(:floor, property: property_1) }
let!(:floor_2) { create(:floor, property: property_2) }
let!(:space_1) { create(:space, floor: floor_1) }
let!(:space_2) { create(:space, floor: floor_2) }
/*:
# A Case of the Missing Unit Test */
/*:
### Type Defs
*/
struct Payload {
let url: String
}
struct FetchListingsAction {
@avegancafe
avegancafe / app.js
Created October 9, 2019 23:55
Dead simple express server
const express = require('express')
const app = express()
app.use('/', express.static('.'))
app.listen(3000, () => console.log('Listening on port 3000...'))
call plug#begin('~/.vim/plugged')
Plug 'junegunn/fzf.vim'
Plug 'junegunn/goyo.vim'
Plug 'dense-analysis/ale'
Plug 'rhysd/committia.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'heavenshell/vim-jsdoc'
Plug 'sbdchd/neoformat'