text
stringlengths
10
2.61M
# == Schema Information # # Table name: u_words # # id :integer not null, primary key # member_id :integer not null # word_id :integer not null # content :string(255) default(""), not null # created_at :datetime not null # updated_at :datetime not nul...
module Ricer::Plugins::Auth class Channelmod < Ricer::Plugin trigger_is :modc has_usage :execute_cshow, '', scope: :channel has_usage :execute_cshowu, '<user>', scope: :channel has_usage :execute_cchange, '<user> <permission>', scope: :channel has_usage :execute_show, '<channel>', scope: :u...
module DataMapper::Mongo::Spec module ReplicaSetHelper def wait_for_primary(name,port,max_retries = 60) 1.upto(max_retries) do |run| connection = Mongo::Connection.new 'localhost',port return if connection.primary? connection.close $stderr.puts "mongod #{name.inspect} is not ...
class Attendance < ApplicationRecord belongs_to :attendee, class_name: 'User', foreign_key: 'attendee_id' belongs_to :event, class_name: 'Event', foreign_key: 'event_id' end
# # Be sure to run `pod lib lint UUShareCommonLib.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'UU...
# frozen_string_literal: true # Class Game class Game attr_accessor :grid def initialize(grid) @grid = grid end def win_game diagonal || vertical || horizontal end # private methods private # Diagonals def diagonal left_diagonal || right_diagonal end def left_diagonal @grid[0...
module ForensicsAPI # A model of Cartesian Co-Ordinate System which can tell 2D position # with the assumption of every movement leading to unit displacement class GridSystem attr_accessor :x, :y def initialize @x, @y = 0, 0 end # Based on facing direction, ...
class GlosentriesController < ApplicationController http_basic_authenticate_with name: "rxj", password: "secret", except: [:index, :show] def glosentry_params params[:glosentry].permit(:picture, :explanation, :keyword) end # GET /glosentries # GET /glosentries.json def index @glosentries = Glosen...
# frozen_string_literal: true # Matrix class Matrix def initialize(args) lines = args.each_line n = lines.count @matrix = Array.new(n) { Array.new(n) } lines.each_with_index do |line, i| line.split.each_with_index { |cell, j| @matrix[i][j] = cell.to_i } end end def rows @matrix e...
module IonicPush class PushService include HTTParty base_uri IonicPush.ionic_api_url attr_accessor :device_tokens, :message def initialize(**args) #args.each &method(:instance_variable_set) args.each do |attr, value| instance_variable_set("@#{attr}", value) end end ...
require File.dirname(__FILE__) + '/../../lib/validation/error_code_checker' # The test names in the original Java code are just plain absurd. However, right now they # are mimicked in this spec. describe ErrorCodeChecker do it 'is error' do ErrorCodeChecker.is_error?("NoError").should be_false ErrorCodeCheck...
class AddColumnsToPortv2 < ActiveRecord::Migration def change add_column :ports, :nativevlan, :string end end
# frozen_string_literal: true desc "Add pokemon from the Alola region" task populate_alola_pokemon: :environment do start_time = Time.now PopulatePokemon::Service.new(722, 809, "Alola").populate time_diff = Time.at(Time.now - start_time).utc.strftime("%T") puts "\nProcess finished in #{time_diff}." end
require 'rails_helper' describe 'an admin' do context 'visiting conditions new path' do it 'can create a new condition and view an accompanying flash message' do admin = create(:user, role: 1) allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(admin) visit new_a...
require 'yt/models/base' module Yt module Models # @private # Encapsulates information about a live video broadcast. # The object will only be present in a video resource if the video is an # upcoming, live, or completed live broadcast. # @see https://developers.google.com/youtube/v3/docs/videos#...
json.(claim, :reference, :case_type, :claim_details, :claimant_count, :date_of_receipt) json.(claim, :desired_outcomes, :discrimination_claims, :is_unfair_dismissal, :jurisdiction, :miscellaneous_information) json.(claim, :is_unfair_dismissal, :office_code, :other_claim_details, :other_known_claimant_names, :other_outc...
class AddColumnHe25He35ForPartWorkerDetails < ActiveRecord::Migration def change add_column :part_worker_details, :he_25, :string add_column :part_worker_details, :he_35, :string end end
module Sass::Tree class RuleNode def _to_s(tabs) tabs = tabs + self.tabs rule_separator = style == :compressed ? ',' : ', ' line_separator = case style when :nested, :expanded; "\n" when :compressed; "" else; " " end rule_indent = ' ' * (tabs...
class User < ActiveRecord::Base attr_accessible :id, :username,:password_confirmation,:password,:crypted_password, :email, :salt, :avatar, :gallery, :level after_create :make_gallery authenticates_with_sorcery! has_many :comments, dependent: :destroy has_many :relationships, foreign_key: "follower_i...
FactoryGirl.define do factory :citizen do phone_number { "1#{Faker::Number.number(10)}" } end factory :keyword_listener do sequence(:keyword) { |n| "keyword#{n}" } listening { create(:poll) } end factory :number_listener do number { "1#{Faker::Number.number(10)}" } listening { create(:qu...
# frozen_string_literal: true # == Schema Information # # Table name: attempt_transitions # # id :bigint(8) not null, primary key # metadata :json # most_recent :boolean not null # sort_key :integer not null # to_state :string not null # created_at :datetime ...
class CreateJournals < ActiveRecord::Migration def change create_table :journals do |t| t.string :name, :null => false t.boolean :is_refereed t.references :country t.references :journal_type t.integer :status, :null => false, :default => 1 t.timestamps ...
require 'rails_helper' RSpec.describe 'new recommendation request page' do # will raise an error if the account has no monthly spending saved: let(:account) { create_account(:eligible, :onboarded, monthly_spending_usd: 1234) } let(:owner) { account.owner } before do create(:spending_info, person: owner,...
# -*- mode: ruby -*- # vi: set ft=ruby : # All Vagrant configuration is done below. The "2" in Vagrant.configure # configures the configuration version (we support older styles for # backwards compatibility). Please don't change it unless you know what # you're doing. Vagrant.configure(2) do |config| config.vm.box =...
require 'csv' require 'roo' require 'roo-xls' require 'odca' require 'tmpdir' require 'securerandom' require 'zip_file_generator' module Services class InputFileService def call( files, with_data_entry, with_default_credential_layout, credential_layout_file, with_default_form_layou...
class Page < ActiveRecord::Base attr_accessible :name, :content, :published validates_presence_of :name belongs_to :ticket belongs_to :user permalinked publishable getter_for :ticket => :name, :user => :name named_scope :recent, :order => 'updated_at DESC' ...
# Virus Predictor # I worked on this challenge [by myself, with: ]. # We spent [#] hours on this challenge. # EXPLANATION OF require_relative #require and require_relative both look for related files to use with the file the method require_relative is in, but require uses a given standard path to search, and require_...
require 'spec_helper' require 'harvest/domain/fishing_ground/order_fulfilment_policies' module Harvest module Domain class FishingGround module OrderFulfilmentPolicies describe OrderFulfilmentPolicies do let(:target) { { "a" => 1, "g" => 7, "b" => 2, "e" => 5, "d" => 4, "c" =...
class ScrapbookController < ApplicationController include ActionView::Helpers::TextHelper skip_before_filter :tweets_by_month, :only => [:archives] def archives @subtitle = "Archives" @archives = Tweet.find(:all, :conditions => {:display => true}, :order => "posted_at DESC").group_by { |tweet| tweet...
require_relative './dance_module.rb' require_relative './class_methods_module.rb' class Kid # include Dance # "include" is just lending methods as instance methods # extend MetaDancing # "extend" allows us to lend methods as class methods to another file # The above method works but is messy, so instead we ...
RSpec.describe Activity::Import::Field do describe ".all" do subject { described_class.all } it "returns an array of all Field objects" do expect(subject.count).to eq 50 expect(subject).to all(be_a(described_class)) linked_activity_id_field = subject.find { |field| field.attribute_name == ...
require "./lib/linked_list" class JungleBeat attr_accessor :list def initialize @list = LinkedList.new end def append(words) sound = words.split sound.each do |word| list.append(word) end end def count list.count end def play @rate = 250 @voice = "Whisper" `say ...
class CreateSynonymsTable < ActiveRecord::Migration def change create_table :synonyms do |t| t.belongs_to :tag t.string :name, null: false end end end
class ProjectSprintPairingScheduler attr_reader :project def initialize(project:) @project = project end def schedule! eligible_sprints = project.sprints.future.or(project.sprints.current).to_a engs = project.engineers.to_a engineer_count = engs.size pairs_per_week = engineer_count / 2 ...
#!/usr/bin/env ruby %w( dataMetaDom dataMetaJacksonSer dataMetaJacksonSer/util ).each(&method(:require)) @source, @target, @formatSpec = ARGV DataMetaJacksonSer::helpDataMetaJacksonSerGen __FILE__ unless @source && @target DataMetaJacksonSer::helpDataMetaJacksonSerGen(__FILE__, "DataMeta DOM source #{@source} is not a...
# frozen_string_literal: true # class Railroad class Railroad attr_reader :stations, :routes, :trains def initialize @stations = [] @routes = [] @trains = [] @wagons = [] end # txt menu def selection(menu) menu.each { |key, value| puts "#{key} - #{value}" } puts 'Выбран пункт:' ...
# # MaiNav Jekyll Page patch # # Adds few functionalities to Page class # # module Jekyll class Page # # page - Page's parent page. # categories - Array of categories the page belongs to. # mlevel - Determines pages hierarchy. # attr_reader :parent, :categories, :mlevel attr_writer :pare...
#!/usr/bin/env ruby $LOAD_PATH << '.' << 'lib' require 'clamp' require 'strava-archiver' Clamp do option ["-o", "--output"], "OUTPUT", "where to write output to", :default => "#{ENV['HOME']}/strava-archive" option ["-s", "--summary"], "SUMMARY", "an existing summary.json file" option ["-t", "--token"], "TOKE...
class Category < ActiveRecord::Base has_many :post_categories has_many :posts, :through => :post_categories end
# frozen_string_literal: true require 'player' require 'dealer' require 'shoe' require 'game' # Class for match actions class Match attr_accessor :shoe, :status def initialize @shoe = Shoe.new @stats = [] go process end def go begin loop do dealer = Dealer.new(Hand.new) ...
require 'spec_helper' describe SysModuleMappingsController do describe "GET 'index'" do it "returns http success" do po = FactoryGirl.create(:sys_user_group) mo = FactoryGirl.create(:sys_module) p = FactoryGirl.create(:sys_module_mapping, :sys_user_group_id => po.id, :sys_module_id => mo.id) ...
require 'spec_helper' describe GroupDocs::Storage::Folder do it_behaves_like GroupDocs::Api::Entity include_examples GroupDocs::Api::Helpers::AccessMode describe '.create!' do before(:each) do mock_api_server(load_json('folder_create')) end it 'accepts access credentials hash' do lambd...
class Libro < PublicacionesPeriodicas attr_accessor :serie, :editorial, :edicion, :isbn def initialize(args) @serie = args[:serie] @editorial = args[:editorial] @edicion = args[:edicion] @isbn = args[:isbn] end def to_s names ="" isbns ="" ...
Given "there is an existing post" do @post = Post.create! :name => "post_name", :title => "post_title" end When "I go to the posts index" do visit "/posts" end When "I go to the post show page" do visit "/posts/#{@post.id}" end When "I go to the new post page" do visit "/posts/new" end When "I submit a new ...
class Student < User def initialize @knowledge = [] end def learn(string) @knowledge << string end def knowledge @knowledge end end
require "wechat_template_content_parser/version" module WechatTemplateContentParser # Public: Parse the wechat template content. # # content - The String to be parsed. # # Examples # # parse("The time: {{time.DATA}}\nThe location: {{location.DATA}}") # # => [:time, :location] # # Returns the...
class CourierUnicode < Formula desc "Courier Unicode Library" homepage "http://www.courier-mta.org/unicode/" url "https://sourceforge.net/projects/courier/files/courier-unicode/2.2.3/courier-unicode-2.2.3.tar.bz2" sha256 "08ecf5dc97529ce3aa9dcaa085860762de636ebef968bf4b6e0cdfaaf18c7aff" depends_on "libiconv"...
class RemoveSummaryOverrideFromCalendars < ActiveRecord::Migration def up remove_column :calendars, :summary_override end def down add_column :calendars, :summary_override, :string end end
class AddLoggeableToActivityLogs < ActiveRecord::Migration def change add_reference :activity_logs, :loggeable, polymorphic: true, index: true end end
# == Schema Information # # Table name: student_applications # # id :integer not null, primary key # created_at :datetime # updated_at :datetime # applicant_id :integer # semester_id :integer # why_join :text # resume_file_name :string(255)...
class SubjectsController < ApplicationController layout 'admin' before_action :confirm_logged_in before_action :count_subjects, :only => [:new, :create, :edit, :update] # Actions related to reading def index logger.debug("*** Testing the logger. ***") # Use named scopes in 'Subject' model to s...
class User < ActiveRecord::Base # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable has_many :posts has_many :pictures belongs_to :background_picture, class_name: "Picture" devise :database_authenticatable, :registerable, :recoverable, :...
class Warrior < ActiveRecord::Base string :name has_one :experience has_many :weapons end
require "pry" def consolidate_cart(cart) cart_hash = {} #=> create new hash cart.each do |item| item_name = item.keys.first #=> .first is same as "element at item zero" #=> item refers to the hash within the Array #=> item.keys.first will grab the key (here a food name) at index zero ...
class ChangeViewTypeToViewType < ActiveRecord::Migration def change rename_column :views, :type, :views_type end end
class CreateBuildings < ActiveRecord::Migration[5.2] def change create_table :buildings do |t| t.string :fullName t.string :email t.string :cellPhone t.string :techName t.string :techPhone t.string :techEmail t.references :address, foreign_key: true t.references :cu...
class CreateMovies < ActiveRecord::Migration def change create_table :movies do |t| t.string :title t.string :title_index t.string :director t.integer :year t.integer :current_rating t.integer :skandies_year t.boolean :short, default: false t.timestamps end ...
require 'puppet/provider/f5' Puppet::Type.type(:f5_partition).provide(:f5_partition, :parent => Puppet::Provider::F5) do @doc = "Manages f5 partition" mk_resource_methods confine :feature => :ruby_savon defaultfor :feature => :ruby_savon def initialize(value={}) super(value) @property_flush = {} ...
# Determines if the two input arrays have the same count of elements # and the same integer values in the same exact order def array_equals(array1, array2) true_false_array = [] if array1 == nil || array2 == nil if array1 == nil && array2 == nil true_false_array << "true" else true_false_array...
# frozen_string_literal: true require 'spec_helper' class ClassDelayTest end RSpec.describe SidekiqSimpleDelay, run_tag: :enable_delay do before(:all) do SidekiqSimpleDelay.enable_delay! end describe 'delayed methods have been added' do it 'simple_delay' do expect(ClassDelayTest.respond_to?(:sim...
class DnsHostRecord < ActiveRecord::Base belongs_to :dns_zone belongs_to :user has_one :dns_host_ip_a_record, :dependent => :destroy has_one :dns_host_ip_aaaa_record, :dependent => :destroy has_one :api_key, as: :dns_entry, :dependent => :destroy validates :name, :presence => true validates :dns_zone, :...
class CreateUserDetails < ActiveRecord::Migration def change create_table :user_details do |t| t.column :user_id, :bigint, :null => false t.column :mobile, :string, :limit => 10, :null => false t.column :city, :string,:limit => 20, :null => true t.timestamps :null => false end end en...
# frozen_string_literal: true require 'go_to_form_helper' feature 'user submits empty checklist' do scenario 'user clicks submit with no corrections' do go_to_form click_button('Submit') expect(page).to have_content('There are no corrections.') expect(page).not_to have_content('Please provide a titl...
class SusuMembership < ApplicationRecord serialize :descriptions, Array # Relationships belongs_to :user belongs_to :susu # Validations validates :susu_id, presence: true validates :user_id, presence: true validates :susu_id, uniqueness: {scope: [:user_id], message: 'You are already added to Su...
## Vagrantfile for SDN class Politecnico di Milano VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/xenial64" #config.vm.box = "ubuntu/bionic64" ## Guest Config config.vm.hostname = "polimi-sdn" # onos gui config.vm.network "forwarded_port", gues...
class CreateProductionPhases < ActiveRecord::Migration[5.0] def change create_table :production_phases do |t| t.string :main_material t.integer :phase_no t.string :initial_letter t.timestamps end end end
module GiftExchange # Just a sample list of members for your gift exchange. Feel free to change/ignore. # # Returns an Array of member names. def self.sample_members ["Sumeet Jain", "Beth Haubert", "Sachin Jain", "Suneel Jain", "Prisha Gupta", "Richa Goyal", "Arjun Goyal", "Judy Haubert"] end # Assign ...
class AddUserIdToTextbooks < ActiveRecord::Migration def change add_column :textbooks, :user_id, :integer add_index :textbooks, :user_id end end
class AddDefaultImageToBook < ActiveRecord::Migration[5.1] def change change_column :books, :image, :text, default: "https://timedotcom.files.wordpress.com/2015/06/521811839-copy.jpg" end end
# frozen_string_literal: true class CreateLimitations < ActiveRecord::Migration[6.0] def change create_table :limitations do |t| t.string :identifier, index: true, unique: true t.integer :maximum_resend, default: 0 t.integer :maximum_try, default: 0 t.datetime :resend_at t.datetime ...
class Invoice < ApplicationRecord validates_presence_of :status belongs_to :customer belongs_to :merchant has_many :transactions has_many :invoice_items has_many :items, through: :invoice_items default_scope {order(id: :asc)} def self.all_transactions(params) joins(:transactions) .where(id: par...
class CommentsController < ApplicationController load_and_authorize_resource def create @comment = Comment.new(comment_params) @comment.post_id = params[:post_id] @comment.save redirect_to post_path(@comment.post) end def destroy @comment.destroy respond_to do |format| format.html { redir...
require_relative '../spec_helper.rb' module RSpecMixin include Rack::Test::Methods def app AuthenticationController end end RSpec.describe 'AuthenticationController' do let(:login_url) { '/auth/login' } let(:success_login_data) do { token: 'token', exp: DateTime.now.strftime('%m-%d-%Y %...
def sort arr # takes an array rec_sort arr, [] #calls the function end def rec_sort unsorted, sorted # takes 2 arrays. sorted will be initially empty. if unsorted.length <= 0 # # if the unsorted array is less or equal to 0 the return sorted. return sorted end smallest = unsorted.pop # the number at the end...
# element.rb module ARTML STD_ELEMENTS = { nil => :General, "'" => :Text, '"' => :Markup, '*' => :Hidden, '[' => :Field, '<' => :Button, '{' => :Selector, '(' => :Radio, '#' => :Counter } # element factory module ElementFactory def self.new( par...
# frozen_string_literal: true module Cinch module Plugin module ClassMethods def use_opped(silent: false) if silent hook :pre, for: [:match], method: :opped_silent? else hook :pre, for: [:match], method: :opped? end end end def opped_silent?(m) ...
module ApplicationHelper def form_group_tag(errors, &block) css_class = 'form-group' css_class << ' has-error' if errors.any? content_tag :div, capture(&block), class: css_class end def is_admin_or_moderator(action) if current_user && (current_user.admin? || (current_user.moderator? && (action...
class ChangePerFormatInEducations < ActiveRecord::Migration[5.0] def change change_column :educations, :per, :string end end
# input: integer # output: negative integer # if argument is positive, turn it into a negative integer # if argument is negative, return the original object # data structure: string # algo: # set new variable as string representation of number # verify if argument is positive or not # if true, use string interpolation ...
require File.dirname(__FILE__) + '/../spec_helper' describe "The -K command line option" do it "doesn't cause errors" do ruby_exe(fixture(__FILE__, "kcode_error.rb"), :options => '-KS').chomp.should == "Pass" end it "sets the $KCODE to SJIS with S" do ruby_exe(fixture(__FILE__, "kcode.rb"), :options =>...
require 'array' describe Array do it { is_expected.to respond_to :molliesinject } it 'can do simple addition' do array = [1, 2, 3, 4, 5, 6, 7, 8] expect(array.molliesinject { |tot, num| tot + num }).to eq(array.inject { |tot, num| tot + num }) end it 'does not return 0 when asked to do multiplication...
require "rails_helper" describe TransferRequest, type: :model do context "validations" do it "is valid with valid attributes" do expect(build(:transfer_request)).to be_valid end end describe "#should_ask?" do it "returns true when the user has active calls" do user = create(:user) ...
class AddUuidColsToBeacons < ActiveRecord::Migration[5.0] def change add_column :beacons, :major_uuid, :string, unique: true, index: true, null: false add_column :beacons, :minor_uuid, :string, unique: true, index: true, null: false end end
class DeleteEmptyUsernames < ActiveRecord::Migration def change User.delete_all username: nil end end
class SurveyQuestion < ActiveRecord::Base def self.all_questions return [ "What is the name of your business?", "Where is your business located?", "On average, how many customers do you serve per day?" # TODO: Add more ] end end
class GoodDog DOG_YEARS = 7 attr_accessor :name, :age def initialize(name, age) @name = name @age = age end def human_age human_years end private def human_years age * 7 end end sparky = GoodDog.new('Sparky', 3) sparky.human_years class Animal def public_method "...
class Node attr_accessor :left, :right, :value, :parent def initialize(value, parent = nil, left = nil, right = nil) @value = value @left = left @right = right @parent = parent end def to_s str = "" str += @value.nil? ? "\t@value: Nil\n" : "\t@value: #{@value}\n" str += @parent.nil? ? "\t@p...
# http://www.mudynamics.com # http://labs.mudynamics.com # http://www.pcapr.net require 'mu/testcase' require 'mu/pcap' module Mu class Pcap class Pkthdr class Test < Mu::TestCase def test_basics pkthdr = Pkthdr.new pkthdr.endian = LITTLE_ENDIAN pkthdr.ts_sec = 1191265036 pkthdr.t...
prometheus_exporter "node_exporter" do action :create checksum 'f175cffc4b96114e336288c9ea54b54abe793ae6fcbec771c81733ebc2d7be7c' uri 'https://github.com/prometheus/node_exporter/releases/download/v1.0.0-rc.0/node_exporter-1.0.0-rc.0.linux-amd64.tar.gz' filename 'node-exporter-1.0.0-rc.0.linux-amd64.tar.gz' p...
class GamesController < ApplicationController def index @games = Game.all end def show @game = Game.find params[:id] end def new @game = Game.new end def create game = @current_user.games.create game_params redirect_to games_path end def edit @game = Game.find params[:id] ...
# CONFIG_PATH="#{Rails.root}/config/application.yml" # # APP_CONFIG = YAML.load_file(CONFIG_PATH)[Rails.env] #directories for maps and layer tileindex shapefiles DST_MAPS_DIR = Rails.root.join('public', 'mapimages', 'dst').to_s SRC_MAPS_DIR = Rails.root.join('public', 'mapimages', 'src').to_s TILEINDEX_DIR = Rails.roo...
class LoanrecordRemindJob < ApplicationJob queue_as :default def perform(*args) @overdue_records = Loanrecord.all.where(status: 'overdue') @overdue_records.each do |record| LoanrecordMailer.overdue_mail(record).deliver_later Rails.logger.info "Scheduled a job to send reminder to user #{record.user.email}...
require_dependency "auth_forum/application_controller" module AuthForum class LineItemsController < ApplicationController before_action :set_line_item, only: [:update, :destroy] def new @line_item = LineItem.new end def create @cart = current_cart quantity = params[:line_item].pres...
shared_examples_for "redirectable" do it "raises a RedirectionError when Location field-value missed" do @request = SMG::HTTP::Request.new(Net::HTTP::Get, @uri) http(@request.uri) stub_response(@code, "GO AWAY") lambda { @request.perform }.should raise_error SMG::HTTP::RedirectionError end it "r...
FactoryBot.define do factory :user do name { Faker::Movies::HarryPotter.character } email { Faker::Internet.unique.email } password {'password'} password_confirmation {'password'} confirmed_at {Time.zone.now} trait :admin do admin {true} end end end
class List < ActiveRecord::Base belongs_to :list belongs_to :user belongs_to :language end
require 'spec_helper' describe "appointments/show.html.erb" do before(:each) do @appointment = assign(:appointment, Factory(:appointment)) @series = assign(:series, @appointment.series) end it "renders attributes in <p>" do render rendered.should have_content(nil.to_s) rendered.should have_c...
namespace :demo do namespace :setup do # desc 'Bootstrap demo plugin' task :bootstrap do set :demo_branch, ask('branch name', fetch(:demo_branch, demo_branch)) set :demo_db, ask('database name', fetch(:demo_db, demo_default_db)) set :release_path, demo_path def current_path de...
require 'docking_station' require 'bike' describe DockingStation do it 'Creates capacity limit defined by user' do docking_station = DockingStation.new 10 expect(docking_station.capacity).to eq 10 end describe'#release_bike' do it "releases a bike" do bike = Bike.new subject.dock(bike) ...
module V1 class Events < Grape::API resource :events do desc 'Get all events' get do present Event.all.limit(20).order_by('date desc'), with: Entities::Event end desc 'Create an event' params do requires :title, type: String, desc: 'Event title' requires :det...