text stringlengths 10 2.61M |
|---|
# frozen_string_literal: true
class Address < ApplicationRecord
belongs_to :user
belongs_to :province
validates :street, :city, :postal_code, presence: true
end
|
class Race
attr_accessor :name, :race_type, :distance, :km_times
def initialize name, race_type, distance, km_times
@name = name
@race_type = race_type
@distance = distance
@km_times = km_times
end
def total_time
@km_times.reduce(:+)
end
def slowest_km
@km_ti... |
require "test/unit"
module Test::Unit
module Doctest
class Runner
attr_reader :test_class, :test_strings
def initialize(file)
@file = file
@test_class = Class.new(Test::Unit::TestCase)
@test_class.define_singleton_method(:to_s) { file }
@test_strings = Parser.new(File... |
module JsonResponseHelper
STATUS_CODE_MAPPINGS = { 'error' => 400,
'created' => 201,
'success' => 200 }.freeze
def status(resource, method_name = nil)
case method_name
when 'index'
find_status(resource)
when 'create'
STATUS_CODE_MAPPINGS... |
require 'spec_helper'
describe Permission do
describe "as guest" do
subject { Permission.new(nil) }
it "allows static pages" do
should allow(:static_pages, :home)
should allow(:static_pages, :help)
end
it "allows sessions" do
should allow(:sessions, :new)
should allow... |
# == Schema Information
#
# Table name: services
#
# id :integer not null, primary key
# name :string
# icon :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Service < ActiveRecord::Base
include ServiceConcern
has_paper_trail
belon... |
meta :repo do
def repo
@repo ||= Babushka::GitRepo.new('.')
end
def ref_data_regexp
# Example: "83a90415670ec7ae4690d58563be628c73900716 e817f54d3e9a2d982b16328f8d7f0fbfcd7433f7 refs/heads/master"
/\A([\da-f]{40}) ([\da-f]{40}) refs\/[^\/]+\/(.+)\z/
end
end
|
require File.dirname(__FILE__) + '/fetcher'
require 'hpricot'
module GroupOpenID
class Client
attr_accessor :user_key, :user_openid, :logger
class <<self
attr_accessor :app_key
end
def initialize(user_openid = '', user_key = '')
@user_key, @user_openid = user_key, user_openid
... |
class TasksController < ApplicationController
before_filter :authenticate_user!
before_filter :get_task,only: [:show,:edit,:update,:assign,:assign_user]
def create
if current_user.is_admin
task=(@task ? @task : Task.new(task_params))
if @task
task.assign_attributes(task_params)
end
... |
class AddFloorToBonds < ActiveRecord::Migration
def self.up
add_column :bonds, :floor, :integer
end
def self.down
remove_column :bonds, :floor
end
end
|
class Room
attr_reader :id, :till, :capacity
attr_accessor :song_list, :guests_inside
def initialize(id, till, song_list, capacity, fee)
@id = id
@till = till
@song_list = song_list
@capacity = capacity
@guests_inside = []
@fee = fee
@bar_tab = []
end
def guest_taker(queue)
... |
require_relative('./film')
require_relative('./ticket')
require_relative('../db/sql_runner')
class Customer
attr_reader :id
attr_accessor :name, :funds
def initialize( options )
@id = options['id'].to_i() if options['id']
@name = options['name']
@funds = options['funds']
end
def save()
sql... |
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
require 'yaml'
desc "Loads cucumber config file"
task :init do
@config = YAML.load_file('.config/cucumber.yaml')
end
#Frequent tasks
desc "Starts the appium server for devices (port and device ID specified)"
task :appium, [:port, :udid] do |t, args... |
class AddUserIdToShelters < ActiveRecord::Migration[6.0]
def change
add_column :shelters, :user_id, :integer
end
end
|
class CreateAccountsTable < ActiveRecord::Migration[5.0]
def change
create_table :accounts do |table|
table.string :name
table.string :lastname
table.string :email
table.string :username
table.boolean :is_author
end
end
end
|
class Api::UsersController < ApplicationController
protect_from_forgery except: :create
skip_before_action :authenticate_user_from_token!, only: [:create, :update]
# before_action :authenticate_user!
def index
render json: User.all, each_serializer: Api::UserSerializer
end
# POST
# Creat... |
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/../../shared_examples/server_examples'
describe 'Fog::Slicehost::Server' do
it_should_behave_like "Server"
# flavor 1 = 256, image 3 = gentoo 2008.0
subject { @server = @servers.new(:flavor_id => 1, :image_id => 3, :name =... |
class Item < ApplicationRecord
belongs_to :user
has_one_attached :image
has_one :buy
with_options presence: true do
validates :image
validates :name
validates :text
validates :price, numericality: true,
numericality: { only_integer: true, greater_than_or_equal_to: 300, les... |
class MakeEventAttendeeKindRequired < ActiveRecord::Migration[6.0]
def change
change_column_null :event_attendees, :kind, false
end
end
|
# encoding: utf-8
require "logstash/outputs/base"
require "logstash/namespace"
class LogStash::Outputs::Slack < LogStash::Outputs::Base
config_name "slack"
milestone 1
# The incoming webhook URI needed to post a message
config :url, :validate => :string, :required => true
# The text to post in slack
conf... |
class CreateUrls < ActiveRecord::Migration[4.2]
def change
create_table :urls do |t|
t.text :url
t.integer :feed_id
t.integer :subscription_id
t.foreign_key :feeds
t.foreign_key :subscriptions
t.timestamps null: false
end
add_index :urls, [:feed_id, :id], unique: true
... |
# Supposed to be name Add Code to Classrooms
class AddCodeToPins < ActiveRecord::Migration
def change
add_column :classrooms, :code, :string
end
end
|
json.purse do
json.id @purse.id
json.created_at time_ago_in_words(@purse.created_at) + ' ' + t('datetime.ago') + ' ' + t('datetime.at') + ' ' + @purse.created_at.strftime("%H:%M")
json.title @purse.title
json.currency_id @purse.currency_id
json.updated_at @purse.updated_at
end
|
# frozen_string_literal: true
module BPS
module PDF
class FloatPlan
module CommunicationInformation
def communication_information(float_plan)
draw_text 'Communication', size: 16, at: [25, 520]
labeled_text('EPIRB Freqs', float_plan.epirb_freqs, x1: 25, x2: 120, y: 500)
... |
# encoding: utf-8
require 'spec_helper'
describe TTY::System::Which, '#which' do
let(:path) { "/usr/local/bin:/usr/local/git/bin" }
let(:extension) { '.bat' }
subject { described_class.new(command) }
context 'without extension' do
let(:command) { 'ruby' }
before {
allow(ENV).to receive(:[]).... |
class AddColumnStripeTokenToAttendees < ActiveRecord::Migration
def change
add_column :attendees, :stripe_token, :string
end
end
|
require 'paperclip'
class User < ActiveRecord::Base
has_many :friendships
has_many :firends, :through => :friendships
has_attached_file :picture,
:styles => { :thumb => "120x120", :medium => "550x550" }
validates_presence_of :firstname, :lastname, :email
validates_uniqueness_of :email
validates_attac... |
#encoding: utf-8
class Account::OrdersController < Account::ApplicationController
set :views, ENV["VIEW_PATH"] + "/account/orders"
# list
# GET /cpanel/orders
get "/" do
@orders = current_user.orders.normals
haml :index, layout: :"../layouts/layout"
end
# create
# POST /cpanel/orders
post "/... |
require 'benchmark'
require 'pry'
class Day12
DIRECTIONS = {
'N' => 0,
'E' => 1,
'S' => 2,
'W' => 3,
}
DIRECTIONS_OFFSET = { # [x,y]
0 => [0,-1],
1 => [1,0],
2 => [0,1],
3 => [-1,0],
}
attr_accessor :current_direction, :position, :waypoint
def initialize(path)
@instruc... |
# -*- encoding : utf-8 -*-
#created with
# rails generate model SavedMeals content:text user:references
class CreateSavedMeals < ActiveRecord::Migration[5.1]
def change
create_table :saved_meals do |t|
t.text :content
t.references :user, foreign_key: true
t.timestamps null: false
end
a... |
class CustomAuthenticationFailure < Devise::FailureApp
def redirect_url
root_path
end
end |
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define :haproxy_0 do |haproxy_0_config|
haproxy_0_config.vm.box = "debian/jessie64"
haproxy_0_config.vm.network "forwarded_port", guest:80, host:81
haproxy_0_config.vm.network "forwarded_port", guest:9000, host:... |
# frozen_string_literal: true
module Blacklight
class DocumentComponent < ::ViewComponent::Base
# Available content areas; some have defaults provided by
# the accessors below.
with_content_areas :header, :body, :footer,
:before_title, :title, :after_title,
:... |
require 'spec_helper'
describe RuboCop::Cop::RSpec::IsExpectedTo do
subject(:cop) { described_class.new }
shared_examples_for 'preferring is_expected.to' do
it 'prefers using is_expected.to to should' do
inspect_source(cop, code)
expect(cop.offenses.size).to eq(1)
expect(cop.messages).to eq ... |
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :configure_permitted_parameters, if: :devise_controller?
after_filter :store_location
before_action :sto... |
require 'rails_helper'
RSpec.describe User, type: :model do
context 'validation test' do
let(:user) { build(:user, username: 'tutie') }
let(:user_two) { build(:user, username: 'tutie') }
it 'ensure name presence' do
user.name = nil
expect(user.save).to eq(false)
end
it 'ensure ema... |
class AddAtarToBooks < ActiveRecord::Migration
def change
change_table :books do |t|
t.float :atar
t.float :price
end
end
end
|
require "test_helper"
class PurchaseTicketsTest < ActionDispatch::IntegrationTest
setup do
@payment_gateway = PaymentGateway::FakeAdapter.new
end
test "customer can purchase tickets to a published concert" do
concert = create(:concert, :published, ticket_price: 3250).add_tickets(3)
expect(PaymentGat... |
require 'rails_helper'
describe User do
describe "#owner?" do
it "return true if role is owner" do
@daniele = FactoryGirl.build(:user)
@daniele.role = "owner"
expect(@daniele.owner?).to eq(true)
end
it "return false for all other roles" do
@user = FactoryGirl.build(:user)
@user.role = "XXX"
... |
# frozen_string_literal: true
require 'active_support/concern'
module FilterTimestamps
extend ActiveSupport::Concern
included do
filter :created_at
filter :updated_at
end
end
|
require "spec_helper"
# expects let{:args} { argument hash to create an instance }
# expects let{:other_args} { different argument hash to create an instance }
shared_examples "a comparable entity" do |entity_class|
class OtherEntity < SimpleDelegator; end
[:==, :eql?].each do |equal_method|
describe "##{eq... |
require_relative 'tables'
# SQL Commands to create table
# CREATE table sold_codes (code TEXT);
class SoldCode < Table
table_name 'sold_codes'
column :code
prep_generic_stmts
def initialize(db_hash)
super(db_hash)
end
def self.sold?(code)
result = select where: 'code = $1', values: [code]
re... |
module CDI
module V1
class StudentClassForStudentSerializer < SimpleStudentClassSerializer
has_one :admin_user, serializer: SimpleUserSerializer
end
end
end
|
FactoryGirl.define do
factory :user do
name "Test User"
email "test@testuser.com"
password "password"
password_confirmation "password"
end
factory :user2 do
name "Example User"
email "example@user.com"
password "password1"
password_confirmation "password1"
end
end
|
class TowersofHanoi
attr_reader :towers
def initialize
@towers = [[1,2,3], [], []]
end
def input_move
begin
puts "Starting tower? (0-2)"
input1 = gets.chomp.to_i
raise InvalidInput.new if input1 > 2
rescue
puts "Destination tower? (0-2)"
input2 = gets.chomp.t... |
=begin
Glassomium - web-based TUIO-enabled window manager
http://www.glassomium.org
Copyright 2012 The Glassomium Authors
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
h... |
module Api
class UsersController < ApiController
def index
users = User.where(status: 'active').count
render json: { count: users }, status: 200
end
def create
user = User.new(create_params)
if user.save
render json: UserSerializer.new(user).serialized_json, status: 201
... |
class SkillsController < ApplicationController
load_and_authorize_resource
def index
@skills = SkillQuery.new.find_all(params)
end
def new
end
def create
@skill = current_user.skills.new build_params(params[:skill])
if @skill.save
redirect_to @skill, notice: I18n.t(:created_successfully... |
SHIP_TYPES = {
:LITTLE => 2,
:MED1 => 3,
:MED2 => 3,
:BIG => 4,
:HUGE => 5
}
class Ship
attr_reader :type, :start_x, :start_y, :end_x, :end_y, :alive
def initialize(type, start_x, start_y, end_x, end_y)
@type = type
@start_x = start_x
@start_y = start_y
@end_x = end_x
@end_y = end_y
... |
#!/usr/bin/env ruby
require 'yaml'
require 'abbrev'
require 'trollop'
require 'highline'
require 'shellwords'
# Work around MacOS X's vendored 'sysexits' that does the same thing,
# but with a different API
gem 'sysexits'
require 'sysexits'
require 'treequel'
require 'treequel/mixins'
require 'treequel/constants'
... |
require 'rails_helper'
RSpec.describe Category, type: :model do
context 'creating categories' do
it 'records cannot be blank ' do
expect { Category.create! }.to raise_error(ActiveRecord::RecordInvalid)
end
end
context 'Creating article on a category' do
let(:category) { Category.create(name: '... |
class CreateApplications < ActiveRecord::Migration
def change
create_table :applications do |t|
t.string :applicant_name
t.date :birth_date
t.string :address
t.integer :phone_number
t.text :likes
t.timestamps null: false
end
end
end
|
# == Schema Information
#
# Table name: heading_bg_images
#
# id :bigint(8) not null, primary key
# heading_bg_image :string
# page_heading_id :bigint(8)
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_heading_bg_images_on_pag... |
class Show < ActiveRecord::Base
def self.highest_rating
self.maximum(:rating)
end
def self.most_popular_show
self.order(:rating).last
end
def self.lowest_rating
self.minimum(:rating)
end
def self.least_popular_show
self.order(:rating).first
end
def self.ratings_sum
self.sum(:rating)
end
# retu... |
require 'test_helper'
class RenewRegionsControllerTest < ActionController::TestCase
setup do
@renew_region = renew_regions(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:renew_regions)
end
test "should get new" do
get :new
assert_res... |
require 'rails_helper'
RSpec.describe "combo_ads/index", type: :view do
before(:each) do
assign(:combo_ads, [
ComboAd.create!(
:base_ad => "Base Ad",
:column => 2,
:row => 3,
:layout => "MyText",
:profile => "Profile"
),
ComboAd.create!(
:base_ad ... |
require 'rails_helper'
RSpec.describe Item, type: :model do
before do
@item = FactoryBot.build(:item)
end
describe '商品の新規登録' do
context '新規登録できるとき' do
it 'image,name,explanation,category_id,condition_id,shipping_charge_id,shipping_area_id,shipping_day_id,item_priceが存在すれば登録できる' do
expect(@it... |
class Contact < ActiveRecord::Base
validates :name, :email, :user_id, presence: true
# may need to go back to
validates :user_id, uniqueness: { scope: :email }
#how to make it so a single user can't have 2 contacts with same email address
belongs_to :user
has_many :contact_shares#, dependent: :dest... |
# frozen_string_literal: true
require 'io/console'
namespace :setup do
task :env do
print 'Enter mysql username (default: root):'
mysql_user = get(default: 'root')
print 'Enter mysql password (default:):'
mysql_pass = get(noecho: true)
print 'Enter redis host (default: localhost:6379)'
red... |
class Tag < ApplicationRecord
has_many :taggings
has_many :events, through: :taggings
end
|
class Address < ActiveRecord::Base
has_many :customer_addresses
has_many :customers, :through => :customer_addresses
end
|
require 'spec_helper'
describe Mavenlink::GoogleDocument, stub_requests: true do
describe '#save' do
context 'persisted record' do
subject { described_class.new(id: 1, private: true) }
it { should be_persisted }
specify do
expect { subject.save }.to raise_error Mavenlink::RecordLocke... |
# frozen_string_literal: true
module TugoCommon
class RequestParamsBase
include ActiveModel::Model
include ActiveModel::Attributes
class InvalidRequestParams < StandardError
attr_reader :errors
def initialize(errors)
@errors = errors
end
end
def validate!
return... |
# Base Parser
module Parsers
class BaseParser
def parse
raise NotImplementedError
end
def self.parsable?(_inst)
raise NotImplementedError
end
protected
def self.digit_regex
/\d+/
end
end
end
|
require 'spec_helper'
describe 'ComprasMedicamentosController' do
let(:plan) do
plan = Plan.new(nombre: 'Neo',
costo: 1000,
cobertura_visitas: CoberturaVisita.new(0, 0),
cobertura_medicamentos: CoberturaMedicamentos.new(0),
cantidad_... |
class NewMailer < ActionMailer::Base
default from: 'info@nwmeeting.com'
def contact_email(name, email, message)
@name = name
@email = email
@message = message
mail(to: 'info@nwmeeting.com', subject: 'New contact email sended.')
end
def email_recieved(email)
@email = email
mail(to: @email... |
describe 'fazer requisicao' do
context 'para alterar dados com' do
it 'put' do
@body_put = {
"id": 1434,
"name": "Sidney 000",
"last_name": "C Salgueiro",
"email": "qa.teste000@gmail.com",
"age": "28",
... |
require "spec_helper"
RSpec.describe Veeqo::Base do
describe ".method_missing" do
context "with existing instance method" do
it "creates a new instace and invoke the method" do
expect(InheritedBase.valid?).to be_truthy
end
end
context "with non existing instance method" do
it "... |
class CreateReponses < ActiveRecord::Migration[5.2]
def change
create_table :reponses do |t|
t.text :content
t.string :distance
t.references :user, foreign_key: true
t.references :favour, foreign_key: true
t.references :event, foreign_key: true
t.references :information, foreig... |
class AddPositionToPlacetextblock < ActiveRecord::Migration
def change
add_column :placetextblocks, :position, :integer, default: 0
Placetextblock.find_each { |b| b.save! }
end
end
|
# typed: true
class CreateEziiZappings < ActiveRecord::Migration[6.0]
def change
create_table :ezii_zappings do |t|
t.text :previous_url
t.text :next_url
t.timestamps
end
end
end
|
# 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... |
require 'spec_helper'
feature 'User edits a topic', %q{
} do
# Acceptance Criteria
#
scenario 'User edits a topic' do
visit root_path
click_on 'Sign In With GitHub'
click_on 'Create a Topic'
fill_in 'Title', with: 'Example Title'
fill_in 'Description', with: 'Example Description'
click_on 'C... |
#
# Cookbook Name:: motd
# Recipe:: default
#
# Copyright 2010, Estately, Inc.
#
# 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 re... |
# frozen_string_literal: true
require 'test_helper'
class WorkspacesControllerTest < ActionDispatch::IntegrationTest
setup do
@workspace = workspaces(:one)
end
test "should get index" do
get workspaces_url
assert_response :success
end
test "should get new" do
get new_workspace_url
asse... |
class AddRecoilToWeapon < ActiveRecord::Migration
def change
add_column :weapons, :recoil, :integer, default: 0
add_column :weapons, :tech_need, :integer, default: 1
end
end
|
require 'open-uri'
# GO
# Source: https://github.com/golang/go/
class Go
@versions
def initialize
@versions = []
extract
end
def latest_stable
@versions.sort.reverse.first
end
def latest_unstable
'Not supported'
end
def versions
@versions.sort.reverse
end
private
def dow... |
class TextPost < Post
validates :body, presence: true
end
|
class CreateRecitalPlaces < ActiveRecord::Migration
def change
create_table :recital_places do |t|
t.integer :nombre_id
t.integer :recital_id
t.timestamps
end
end
end
|
#
# Copyright 2011-2013, Dell
# Copyright 2013-2014, SUSE LINUX Products GmbH
#
# 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 requi... |
class Team < ActiveRecord::Base
has_many :games, :foreign_key => "home_team_id"
has_many :games, :foreign_key => "away_team_id"
has_many :stadia, through: :games
end
|
class Word
attr_accessor :text, :hits
def initialize(text, hits)
@text = text
@hits = hits
end
end
|
#!/usr/bin/ruby
# ClanSphere 2011.3 (cs_lang cookie parameter) LFI exploit by blkhtc0rp
# Prior versions should a... |
class CreateDeliveries < ActiveRecord::Migration[6.0]
def change
create_table :deliveries do |t|
t.string :postal_code,null: false
t.integer :area_id,null: false
t.string :cities,null: false
t.text :add,null: false
t.string :bill_name
t.string :phone,null: false
t.referen... |
module Kafkat
module Command
class TopicCreate < Base
register_as 'topic_create'
banner 'kafkat topic create TOPIC'
description 'Create a new topic'
option :replication_factor,
short: '-R',
long: '--replicas NUM',
description: 'The number of replicas',
defa... |
require 'ostruct'
module Rhouse::Models
class Device < ActiveRecord::Base
set_table_name 'Device'
set_primary_key "PK_#{Device.table_name}"
# relationships...
belongs_to :template,
:foreign_key => "FK_DeviceTemplate",
:class_name => "Rhouse::Models::DeviceTemplate"
belongs_to :... |
require 'csv'
class SplitData
def initialize(csv_file, csv_target)
@csv_file = csv_file
@csv_target = csv_target
end
def execute
rows = []
headers = CSV.read(@csv_file, headers: true, encoding: 'iso-8859-1:utf-8').headers
hash_h = headers_to_hash(headers)
CSV.foreach(@csv_file, headers: ... |
class Artist < ActiveRecord::Base
attr_accessible :name, :description, :category_id, :year
belongs_to :category
belongs_to :user
has_one :image
has_many :musics, :dependent => :destroy
has_many :books, :dependent => :destroy
#validates_presence_of :category_id
YEARS = ["1990","1991","1992","1993","199... |
# frozen_string_literal: true
gem 'cassandra-driver'
require 'cassandra'
require 'logger'
module CassandraObject
module Adapters
class CassandraAdapter < AbstractAdapter
class QueryBuilder
def initialize(adapter, scope)
@adapter = adapter
@scope = scope
end
def... |
class ArticlesController < ApplicationController
def index
if params[:category_id]
@articles_pages, @articles = paginate(:articles, :include => :faculty, :order => 'published_at DESC', :conditions => "category_id=#{params[:category_id].to_i} AND published=true")
else
@articles = Articles.find_all_by_publis... |
Rails.application.routes.draw do
devise_for :users
resources :position_papers, except: [:edit, :update, :show]
get '/download/:id' => 'position_papers#download', as: 'download'
resources :topics, only: [:index]
root 'position_papers#index'
end
|
require File.dirname(__FILE__) + '/../../spec_helper'
describe "/foros/edit.html.erb" do
include ForosHelper
before do
@foro = mock_model(Foro)
@foro.stub!(:titulo).and_return("MyString")
@foro.stub!(:mensaje).and_return("MyText")
@foro.stub!(:puntuacion).and_return("1")
assigns[:foro] = @fo... |
class FeaturedComment < ActiveRecord::Base
self.table_name = 'contentbase_featuredcomment'
outpost_model
has_secretary
include Concern::Callbacks::SphinxIndexCallback
include Concern::Callbacks::HomepageCachingCallback
include Concern::Methods::PublishingMethods
STATUS_DRAFT = 0
STATUS_LIVE = 5
ST... |
FactoryBot.define do
factory :model do
name { Faker::Device.model_name }
model_number { Faker::Device.serial }
company
category { association :category, company: company }
manufacturer { association :manufacturer, company: company }
end
end
|
# frozen_string_literal: true
# rspec ./spec/lib/statistic_calcs/distributions/binomial_spec.rb
require 'statistic_calcs/distributions/binomial'
# rubocop:disable BlockLength
RSpec.describe StatisticCalcs::Distributions::Binomial do
subject { StatisticCalcs::Distributions::Binomial.new(options) }
before { subjec... |
require 'test_helper'
class PositionsControllerTest < ActionDispatch::IntegrationTest
setup do
@position = positions(:one)
end
test "should get index" do
get positions_url
assert_response :success
end
test "should get new" do
get new_position_url
assert_response :success
end
test "... |
require 'spec_helper'
describe "raw_touch_data/new" do
before(:each) do
assign(:raw_touch_datum, stub_model(RawTouchDatum,
:phase => 1,
:radius => 1.5,
:timestamp => 1.5,
:x => 1.5,
:y => 1.5
).as_new_record)
end
it "renders new raw_touch_datum form" do
render
# Ru... |
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "loudmouth"
s.version = "0.2.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubyge... |
# frozen_string_literal: true
require_relative 'helpers/options_exist'
require_relative 'types/action_type'
module StringCheese
# Provides callback methods for attribute observers
module AttrObserver
include Helpers::OptionsExist
# Observer update method called after an attr_reader action takes place
... |
module Fog
module DNS
class PowerDNS
class Real
# Get a specific config setting of one server
# TODO: Can only get / retrieve recursor's allow_from
#
# ==== Parameters
# * server<~String> - server id
# * config<~String> - config name
#
# ==== R... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.