text stringlengths 10 2.61M |
|---|
module Api
module V2
class WorkspaceResource < BaseResource
model_name 'Team'
attributes :name, :slug
paginator :none
filter :is_tipline_installed, apply: ->(records, value, _options) {
self.has_bot_installed(records, value, BotUser.smooch_user)
}
filter :is_similarit... |
# ****************************************************************************
#
# Copyright (c) Microsoft Corporation.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of this distribution. If
# you ... |
require 'poundpay'
require 'poundpay/elements'
require 'fixtures/payments'
require 'fixtures/developers'
include Poundpay
describe Developer do
include DeveloperFixture
before (:all) do
Poundpay.configure(
"DV0383d447360511e0bbac00264a09ff3c",
"c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449... |
require_relative '../lib/game.rb'
RSpec.describe Game do
let(:grid) {[[1, 2, 3], [4, 5, 6], [7, 8, 9]]}
let(:result) { Game.new(grid)}
describe "# Result" do
it "grid and with pieces" do
expect(result.grid).to eql(grid)
end
end
describe "winning positions" do
let(:horizontal_position) { [[1... |
class CategoriesController < ApplicationController
# GET /categories
# GET /categories.json
def index
Rails.logger.puts params[:image_id].inspect
if (params[:image_id])
@categories = Image.find(params[:image_id]).categories
else
@categories = Category.all
end
# Serve the categor... |
class CreateEasyRakeTaskInfo < ActiveRecord::Migration
def self.up
create_table :easy_rake_task_infos, :force => true do |t|
t.column :easy_rake_task_id, :integer, {:null => false}
t.column :status, :integer, {:null => false}
t.column :started_at, :datetime, {:null => false}
t.column :fin... |
module Alchemy
class Page < ActiveRecord::Base
DEFAULT_ATTRIBUTES_FOR_COPY = {
:do_not_autogenerate => true,
:do_not_sweep => true,
:visible => false,
:public => false,
:locked => false,
:locked_by => nil
}
SKIPPED_ATTRIBUTES_ON_COPY = %w(id updated_at created_at creat... |
#
# This file was ported to ruby from Composer php source code file.
#
# Original Source: Composer\Json\JsonFormatter.php
# Ref SHA: ce085826711a6354024203c6530ee0b56fea9c13
#
# (c) Nils Adermann <naderman@naderman.de>
# Jordi Boggiano <j.boggiano@seld.be>
#
# For the full copyright and license information, please ... |
require 'rails_helper'
RSpec.describe Manufacturer, type: :model do
subject { Manufacturer.new }
include_examples 'required attributes', %i[name]
include_examples 'optional attributes', %i[short]
it 'can be created' do
manufacturer = Manufacturer.new(name: 'Drake Interplanetary', short: 'Drake')
expe... |
class User < ApplicationRecord
has_secure_password validations: false # => removes password_confirmation check
# Relationships
has_many :bookings
# Enums
enum role: [ :guest, :family, :admin ]
# Validations
validates :first_name, :last_name, :phone_number, presence: true
validates :password, presence... |
require 'spec_helper'
module DmtdVbmappData
describe Protocol do
AVAILABLE_LANGUAGES.each do |language|
context "Language: #{language}" do
it 'can be created' do
client = Client.new(date_of_birth: Date.today, gender: DmtdVbmappData::GENDER_FEMALE, language: language)
expect(... |
class CreateAuditFieldValues < ActiveRecord::Migration
def change
create_table :audit_field_values, id: :uuid do |t|
t.uuid :audit_field_id, index: true
t.uuid :audit_structure_id, index: true
t.string :string_value
t.float :float_value
t.decimal :decimal_value
t.integer :integ... |
class Definition < ActiveRecord::Base
belongs_to :glossary
has_many :meanings
def meanings_or_new
meanings.empty? ? [Meaning.new] : meanings
end
end
|
class CreateServicePricingTiers < ActiveRecord::Migration
def change
create_table :service_pricing_tiers do |t|
t.integer :user_id
t.integer :service_pricing_scheme_id
t.float :upto
t.datetime :valid_from
t.datetime :valid_to
t.decimal :unit_price
t.timestamps
end
... |
class UpdateChannelScraper
include Sidekiq::Worker
sidekiq_options retry: false
def perform(id)
@channel = Channel.find(id)
@channel.update
end
end
|
Rails.application.routes.draw do
root to: 'main#index'
resources :main, only: %i[ create ], path: '/'
end
|
class StringTooBig < StandardError
def initialize(msg="The size of the string is too large for SteggyHide to handle.")
super(msg)
end
end |
require 'httparty'
require 'cgi'
class C2DM
include HTTParty
default_timeout 30
attr_accessor :timeout, :auth_token
AUTH_URL = 'https://www.google.com/accounts/ClientLogin'
PUSH_URL = 'https://android.apis.google.com/c2dm/send'
class << self
attr_accessor :auth_token
def authenticate!(username,... |
class UserConnectionTable < ActiveRecord::Migration
def change
create_table :user_connections, :id=>false do |t|
t.integer "followee_id", :null => false
t.integer "follower_id", :null => false
end
end
end
|
require 'spec_helper'
describe Smsapi::SMS do
describe "#deliver" do
let(:sms) { Smsapi::SMS.new('to', 'message', server, {}) }
let(:server) { instance_double(Smsapi::Server, sms: response) }
subject { sms.deliver }
context "success" do
let(:response) { ["OK:7777:0.7"] }
it { expect(su... |
# frozen_string_literal: true
class EventMessage < ApplicationRecord
module MessageType
INFORMATION = 'INFORMATION'
INVITATION = 'INVITATION'
REMINDER = 'REMINDER'
SIGNUP_CONFIRMATION = 'SIGNUP_CONFIRMATION'
SIGNUP_REJECTION = 'SIGNUP_REJECTION'
end
module Templates
SIGNUP_CONFIRMATION_S... |
class User < ApplicationRecord
validates_presence_of :name
def full_name
[first_name, middle_initial_with period, last_name].compact.join(' ')
end
def middle_initial_with_period
"#{middle_initial}." unless middle_initial.blank?
end
end
|
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
version = File.read(File.expand_path('../VERSION', __FILE__)).strip
Gem::Specification.new do |spec|
spec.name = "omniauth-open-wechat-oauth2"
spec.version = version
spec.authors ... |
require_relative '../test_helper'
class TaskManagerTest < ModelTest
def test_it_creates_a_task
TaskManager.create({ :title => "a title",
:description => "a description"})
task = TaskManager.find(1)
# task = TaskManager.database.where(id: 1)
assert_equal "a title", tas... |
class AddBattletagToAccounts < ActiveRecord::Migration[5.1]
def change
add_column :oauth_accounts, :battletag, :string
end
end
|
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_many :posts, dependent: :destroy #... |
class ChangeTypeForApplications < ActiveRecord::Migration[5.0]
def change
change_column_null(:applications, :university, true)
change_column_null(:applications, :travel_origin, true)
change_column_null(:applications, :major, true)
end
end
|
class CobrandHost < ActiveRecord::Base
belongs_to :cobrand
validates_presence_of :name, :google_maps_api_key
validates_uniqueness_of :name
end
|
# -*- coding: utf-8 -*-
require 'write_xlsx/package/xml_writer_simple'
require 'write_xlsx/utility'
module Writexlsx
module Package
class Comments
include Writexlsx::Utility
def initialize
@writer = Package::XMLWriterSimple.new
@author_ids = {}
end
def set_xml_writer(fi... |
class LinksController < ApplicationController
before_filter :signed_in_user, only: [:edit, :destroy, :update]
before_filter :correct_user, only: [:edit, :destroy, :update]
def index
end
def create
if signed_in?
@link = current_user.links.build(params[:link])
else
@link = Link.new(params[:link])
en... |
require 'test_helper'
class WelcomeControllerTest < ActionDispatch::IntegrationTest
test "json endpoint should translate" do
expected_response = {
"navbar": [{"link": {"url" => "www.example.com", "text" => "home"}}, {"link": {"url" => "www.example.com", "text" => "about"}}],
"title": {"text" => "Seño... |
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... |
class Menu
attr_accessor :dish
def initialize
@dish = []
end
def set(*dish)
@dish << dish
end
def dish_count
@dish.count
end
end |
class OrdenproduccionsController < ApplicationController
before_action :set_ordenproduccion, only: [:show, :edit, :update, :destroy]
# GET /ordenproduccions
# GET /ordenproduccions.json
def index
@ordenproduccions = Ordenproduccion.all
end
# GET /ordenproduccions/1
# GET /ordenproduccions/1.json
d... |
require "toastmasters/mappers/base_mapper"
module Toastmasters
module Mappers
class MeetingMapper < BaseMapper
attributes :id, :date, :note
end
end
end
|
class ShiftWorkCenterDecorator < ApplicationDecorator
delegate_all
def work_center_title
h.link_to object.work_center_title, h.edit_shift_work_center_path(object)
end
def relevance
h.check_box_tag 'shift_work_centrs[]', object.relevance , object.relevance,{ :disabled => "disabled"}
end
def sh... |
if not @error
json.success true
json.set! :result do
json.extract! @contact, :id, :user_id, :name, :email, :phone, :description, :status
end
else
json.success false
json.error @error
end
|
class AddReferenceOfCategoryToWorklist < ActiveRecord::Migration[6.0]
def change
add_reference :work_lists, :category, foreign_key: true
end
end
|
class Task < ActiveRecord::Base
validates_presence_of :title
validate :future_completed_date
private
def future_completed_date
if !completed.blank? && completed > Date.today
self.errors.add(:completed, "can't be in the future")
end
end
end
|
require 'test_helper'
class HelpersTest < ActionController::TestCase
tests ApplicationController
def setup
@warden = mock()
@controller.request.env['warden'] = @warden
end
test 'proxy to Warden manager' do
assert_equal @controller.warden, @warden
end
test 'proxy #login to Warden #authenticat... |
# encoding: utf-8
class Base < CarrierWave::Uploader::Base
storage :file
def store_dir
Iqvoc.upload_path.join(model.class.to_s.downcase)
end
def filename
"#{secure_token}.#{file.extension}" if original_filename.present?
end
protected
# https://github.com/jnicklas/carrierwave/wiki/How-to%3A-Cr... |
class AddPrice < ActiveRecord::Migration[5.2]
def self.up
add_column :parking_slot_reservations, :price, :integer
add_column :parking_slot_reservations, :subtotal, :integer
end
def self.down
remove_column :parking_slot_reservations, :price
remove_column :parking_slot_reservations, :subtotal
end... |
class ApplicationController < ActionController::API
include ActionController::MimeResponds
include ActionController::Cookies
include ActionController::RequestForgeryProtection
include Response
include ErrorHandler
include Authorization
before_action :set_csrf_cookie
private
def set_csrf_cookie
... |
FactoryBot.define do
factory :service_area_code do
name { [Faker::Address.state_abbr, Faker::Number.number(3)].join }
end
end
|
class Api::V1::StepsController < ApplicationController
before_action :authenticate_user
def show
step = Step.find(params[:id])
render json: step
end
def create
step = Step.new(step_params)
job = Job.find(params[:job_id])
step.job = job
if step.save
render json: StepSerializer.new(... |
class NewsletterController < ApplicationController
def signup
@newsletter_signup = NewsletterSignup.new :email => params[:email]
respond_to do |format|
if @newsletter_signup.valid? and @newsletter_signup.save
Notifications.newsletter_signup(params[:email]).deliver
format.js... |
class CreateTreatments < ActiveRecord::Migration[5.0]
def change
create_table :treatments do |t|
t.integer :field_id
t.date :date
t.integer :si
t.float :dose
t.integer :remedy_id
t.string :goal
t.string :establishment
t.string :weather
t.string :operator
... |
# frozen_string_literal: true
require 'spec_helper'
describe RubyPx::Dataset do
let(:subject) { described_class.new 'spec/fixtures/ine-padron-2014.px' }
context "ine-padron-2014.px" do
describe '#headings' do
it 'should return the list of headings described in the file' do
expect(subject.headin... |
require 'farandula/constants'
require 'farandula/flight_managers/flight_manager'
require 'farandula/utils/logger_utils'
require 'farandula/models/itinerary'
require 'farandula/models/air_leg'
require 'farandula/models/segment'
require 'farandula/models/seat'
require 'farandula/models/fares'
require 'farandula/models/pr... |
module Rightboat
module ParamsReader
def read_str(str)
str.strip if str.present?
end
def read_downcase_str(str)
if (str = read_str(str))
str.downcase
end
end
def read_id(str)
case str
when Numeric then str
when String then str.to_i if str.strip =~ /\A... |
require 'formula'
class StyleCheck < Formula
homepage 'http://www.cs.umd.edu/~nspring/software/style-check-readme.html'
url 'http://www.cs.umd.edu/~nspring/software/style-check-0.14.tar.gz'
sha1 '7308ba19fb05a84e2a8cad935b8056feba63d83b'
def install
inreplace "style-check.rb", '/etc/style-check.d/', etc+'... |
class AddExceptionDateToPeriods < ActiveRecord::Migration
def change
add_column :periods, :exception_date, :text
end
end
|
require_relative "base_nmea"
module NMEAPlus
module Message
module NMEA
# VWR - Relative Wind Speed and Angle
class VWR < NMEAPlus::Message::NMEA::NMEAMessage
field_reader :wind_direction_degrees, 1, :_float
field_reader :wind_direction_bow, 2, :_string
field_reader :speed_kno... |
require 'spec_helper'
describe SemanticNavigation::TwitterBootstrap::Breadcrumb do
context :renders do
before :each do
class ViewObject
attr_accessor :output_buffer
include ActionView::Helpers::TagHelper
include SemanticNavigation::HelperMethods
include... |
class CreateAttributionSecurities < ActiveRecord::Migration
def change
create_table :attribution_securities do |t|
t.string :cusip
t.string :ticker
t.date :effective_on
t.timestamps null: false
end
end
end
|
#
# vmstat用
#
# *** vmstatコマンドの実行例 ***
# procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
# r b swpd free buff cache si so bi bo in cs us sy id wa st
# 0 0 0 233000 9596 121264 0 0 27 1 853 41 2 1 97 0 0
#
# vmstatの結果を格納するクラス
class VmI... |
class RegistrationsController < ApplicationController
before_filter :require_logout
def new
@registration = Registration.new
end
def create
@registration = Registration.new(params[:registration])
if @registration.submit
login @registration.user
flash[:success] = "Account created!"
... |
# -*- mode: ruby -*-
# vi: set ft=ruby :
current_path = File.dirname(__FILE__)
hostname = "vagrant-base-trusty32"
aliases = ""
server_cpus = "1"
server_memory = "512"
server_ip = "192.168.33.10"
# set the http://proxy-address-and:port here if you need to, eg, http://proxy.example.org:3128
proxy_addr = ""
Vagrant.con... |
module Ecm::Tournaments
class Tournament < ActiveRecord::Base
# associations
belongs_to :ecm_tournaments_series, :class_name => Series,
:foreign_key => :ecm_tournaments_series_id
belongs_to :ecm_tournaments_type, :class_name => Type,
... |
class RelinkPurchaseToPayment < ActiveRecord::Migration
def up
if (Purchase.new.attributes.has_key?(:order_id.to_s))
end
add_column :purchases, :payment_id, :integer
end
def down
remove_column :purchases, :payment_id
end
end
|
class CSVDiff
# Defines functionality for exporting a Diff report to Excel in XLSX format
# using the Axlsx library.
module Excel
private
# Generare a diff report in XLSX format.
def xl_output(output)
require 'axlsx'
# Create workbook
xl = xl_... |
# Facebook Thread Message class
class FacebookMessage < ActiveRecord::Base
belongs_to :facebook_thread, :counter_cache => 'message_count'
belongs_to :facebook_account, :foreign_key => 'backup_source_id'
has_one :member, :through => :facebook_account
serialize :attachment
validates_presence_of :message_id,... |
class Rsvp < ActiveRecord::Base
belongs_to :rsvpable, :polymorphic => true
belongs_to :user
validates_presence_of :first_name, :last_name, :email, :if => Proc.new{|r| r.user.nil?}
validates_numericality_of :attendee_count, :only_integer => true, :greater_than => 0, :allow_nil => true
validates_format_o... |
class CreateMenuPages < ActiveRecord::Migration[5.1]
def change
create_table :menu_pages do |t|
t.integer :page_number
t.integer :full_height
t.integer :full_width
t.integer :image_id
t.string :uuid
t.references :menu
t.timestamps
end
end
end
|
module SurveyBuilder
module Questions
class Checkbox < Question
store_accessor :question_data, :helper_text, :options
def self.construct_question_data(raw_data)
return raw_data.permit(:options, :helper_text).to_json
end
... |
# # encoding: utf-8
# Inspec test for recipe set_proxy::default
# The Inspec reference, with examples and extensive documentation, can be
# found at https://docs.chef.io/inspec_reference.html
unless os.windows?
describe user('root') do
it { should exist }
skip 'This is an example test, replace with your ow... |
#
# Copyright 2011 National Institute of Informatics.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
FactoryGirl.define do
factory :user do
sequence(:username) { |n| "johny #{n}" }
sequence(:email) { |n| "johny_#{n}@gmail.com" }
about "Let others speak for me."
first_name "John"
last_name "Markovich"
factory :user_with_stories do
ignore do
story_count 5
end
after(:c... |
class RsvpController < ApplicationController
def index
end
def new
@partial = nil
@code = params[:code]
if Guest.valid_and_redeemable?(@code)
@partial = render_to_string(template: 'shared/_rsvp', layout: false )
else
@partial = render_to_string(template: 'shared/_rsvp_used', layout: ... |
#!/usr/bin/env ruby
# This script uploads sourcemaps to Sentry so we can see symbol names for exceptions.
# It is based on this: https://github.com/expo/sentry-expo/blob/master/upload-sourcemaps.js
#
# We can't use the expo postPublish hook as suggested since we're self-hosting the app.
require "json"
path_to_creden... |
require 'rails_helper'
describe 'titles/index.json.jbuilder' do
before(:each) do
@titles = assign(:titles, Kaminari.paginate_array(FactoryGirl.create_list(:title, 4)).page(1))
assign(:watching_ids, [@titles.first.id])
@options = assign(:options, page: 1)
end
it 'render json' do
render
json = ... |
class Goal < ActiveRecord::Base
validates_presence_of :name
belongs_to :resolution
def self.completed_goals
where(completed: true)
end
def self.current_goals
where(completed: false)
end
end
|
require 'test_helper'
class Blade::RailsPluginTest < Minitest::Test
def setup
Blade.initialize!(interface: 'ci', plugins: { rails: {} }, load_paths: "test/javascripts/src")
@load_paths = Blade.config.load_paths
end
def test_that_it_has_a_version_number
refute_nil ::Blade::RailsPlugin::VERSION
end
... |
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
helper_method :current_user, :logged_in?, :same_as_current_user?, :show_action?
def current_user
@current_user ||= User.find(session[:user_id]) if session[:user_id]
end
def logged_in?
!!current_user
end
... |
class AddColumnIpAddressToFondsTable < ActiveRecord::Migration
def self.up
add_column :fonds, :ip_address, :string
add_index :fonds, :ip_address
end
def self.down
remove_column :fonds, :ip_address
remove_index :fonds, :ip_address
end
end
|
class Admin < ActiveRecord::Base
attr_accessible :email, :password, :username
before_save :encrypt_psw
def encrypt_psw
self.password = Digest::SHA1.hexdigest(self.password)
end
end
|
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :authenticate
#come back later
# before_action :authenticate, only: [:index]
helper_method :current_user
def current_user
return User.find(session[:user_id])
end
private
def authenticate
... |
class LargestProductSeries
def initialize(data)
@data = data.to_s.chars
end
def series_of(chunk_size)
products = []
@data.each_cons(chunk_size) do |group|
products << group.map(&:to_i).reduce(:*)
end
products.max
end
end
|
class RemovePetFromProperties < ActiveRecord::Migration[6.1]
def change
remove_column :properties, :pet, :boolean
end
end
|
class Node
attr_reader :value, :children
def initialize(value)
@value = value
@children = []
end
def add_child(value)
n = Node.new(value)
@children << n
n
end
def dfs(value)
# if the given value is the same as this node - return self
# Otherwise call dfs on each child and see ... |
class CreateExercises < ActiveRecord::Migration[6.0]
def change
create_table :exercises do |t|
t.string :name
t.datetime :date_performed
t.string :sets_reps_weights
t.integer :goal_id
t.integer :workout_id
t.timestamps
end
end
end
|
class Venda < ApplicationRecord
has_one :cliente
has_one :produto
validates :clienteId, presence: { message: 'é um campo obrigatório' }
validates :produtoId, presence: { message: 'é um campo obrigatório' }
validates :valorServico, length: {maximum: 6, message: 'excede o valor padrão d... |
Rails.application.routes.draw do
resources :thumbnails
resources :portfolios
resources :tests
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
|
class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
before_action :set_locale
def default_url_options
I18n.locale == I18n.default_locale ? { lang: nil } : { lang: I18n.locale }
end
def after_sign_in_path_for(resource)
flash[:not... |
class Order < ApplicationRecord
belongs_to :user
has_many :order_details, dependent: :destroy
enum status: {waiting: 0, delivering: 1, delivered: 2, cancel: 3}
before_save :update_total
scope :find_order_by_status, ->(status){where(status: status)}
def total
order_details.map{|od| od.valid? ? od.quantit... |
module EasyPatch
module VersionPatch
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
attr_accessor :css_shared
base.class_eval do
has_many :relations_from, :class_name => 'EasyVersionRelation', :foreign_key => 'version_from_id', :dependent... |
require "alphabet_calc/alphabet_digit"
module AlphabetCalc
class AlphabetNum
def initialize(input)
@digits = Array.new
if input.is_a?(Integer)
@digits.unshift AlphabetDigit.new(0) if input == 0
while input > 0 do
@digits.unshift AlphabetDigit.new( input % 26 )
inp... |
class TaskMailer < ApplicationMailer
default from: 'xargrigoris@gmail.com'
layout 'mailer'
def new_task(user, task)
@user = user
@task = task
mail(to: @user.email, subject: @task.name)
end
end
|
class GeocodeApi
# ApiKeys
ApiKeys = {
map_quest: 'Fmjtd%7Cluur206y2q%2Crw%3Do5-9ay2dy',
bing: 'Ao9yUqipvyK9Gyt1jZEiolDPDNQ4evUSSKlvUN7t0rx0iiD-u9uMNeHsojrRyNVY',
geonames: 'nomadop'
}
RegApis = [:google, :map_quest, :bing, :geonames, :multi]
def self.geocode address, api, opts = {}
raise 'No such api' u... |
# This migration comes from keppler_capsules (originally 20180802184153)
class CreateKepplerCapsulesCapsules < ActiveRecord::Migration[5.2]
def change
create_table :keppler_capsules_capsules do |t|
t.string :name
t.integer :position
t.datetime :deleted_at
t.timestamps
end
add_inde... |
FactoryGirl.define do
factory :room, aliases:[:test_chamber] do
name "Test Chamber"
description Forgery::LoremIpsum.paragraphs(3)
end
end |
$:.push File.expand_path("../lib", __FILE__)
require 'image_gps/version'
Gem::Specification.new do |s|
s.name = ImageGps::NAME
s.version = ImageGps::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Tom Kulmacz"]
s.email = ["tomek.kulmacz@gmail.com"]
s.homepage = "https://g... |
require 'spec_helper'
describe 'crashkernel fact' do
before :each do
Facter.clear
end
context 'kernel is linux' do
it 'returns crashkernel' do
allow(Facter::Core::Execution).to receive(:exec).with('uname -s').and_return('Linux')
allow(Facter).to receive(:value).with(:kdump_kernel_arguments).... |
# == Schema Information
#
# Table name: scholarships
#
# id :integer not null, primary key
# name :string(255) default(""), not null
# status_id :integer default(1), not null
# end_date :datetime not null
# copy ... |
module DungeonMaster
class Master
def self.provider_for(game, user, text)
if game.rounds.empty?
round = game.rounds.create :kind => 'password'
else
round = game.active_round
end
"::DungeonMaster::#{round.kind.capitalize}Provider".constantize.new(game, round, user, text)
... |
require 'spec_helper'
describe 'sensu::repo::yum', :type => :class do
context 'ensure: present' do
let(:params) { { :ensure => 'present' } }
it { should contain_yumrepo('sensu').with(
'enabled' => 1,
'baseurl' => 'http://repos.sensuapp.org/yum/el/$releasever/$basearch/',
'gpgcheck' =>... |
class SongSerializer < ActiveModel::Serializer
attributes :id, :title, :categories, :docs
has_many :docs
end
|
require 'rails_helper'
RSpec.feature "Users list" do
feature "as a registered admin" do
given! (:admin2) { create(:user, :admin, :registered, email: "margoulin@free.fr") }
given (:admin) { create(:user, :admin, :registered, lastname: "ADMIN") }
given! (:player) { create(:user, :player, :registered, last... |
require "application_system_test_case"
class GalaxiesTest < ApplicationSystemTestCase
setup do
@galaxy = galaxies(:one)
end
test "visiting the index" do
visit galaxies_url
assert_selector "h1", text: "Galaxies"
end
test "creating a Galaxy" do
visit galaxies_url
click_on "New Galaxy"
... |
# ==========================================================================
# Project: Lebowski Framework - The SproutCore Test Automation Framework
# License: Licensed under MIT license (see License.txt)
# ==========================================================================
module Lebowski
module RSpec
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.