text
stringlengths
10
2.61M
require 'rails_helper' RSpec.describe WebHookEngine::TicketsUpdater do let(:parsed_push_payload) do push_payload = JSON.parse(File.read("#{Rails.root}/spec/fixtures/ready_for_release.json")) WebHookEngine::PayloadParser.parse_payload(push_payload) end let(:parsed_release_payload) do release_payload...
# if you have an array of arrays you can array[i][j] # with method join, make sure to do join(' ') so you have a space between each word # there is a thing called aliasing. be very careful of this. # when you have two arrays and you do array2 = array1, if you change one array the other changes as well # you don't copy...
module ForgottenStepDefinitions class StepDefinitionParser def parse(file) File.foreach(file).with_index.map {|content, line| if is_step_definition?(content) && regex = extract_regex(content) StepDefinition.new file: file, line: line, regex: regex, raw_content: content end }...
# frozen_string_literal: true class RemoveCreatedByUserIdAndAddSubmittedByUserIdToTalkSummaries < ActiveRecord::Migration[5.1] def change remove_column :talk_summaries, :created_by_user_id add_reference( :talk_summaries, :submitted_by_user, index: true, null: false, foreign_key: { to_table:...
# require gems require 'sinatra' require 'sqlite3' db = SQLite3::Database.new("students.db") db.results_as_hash = true # write a basic GET route # add a query parameter # GET / # EXPLANATION: when server gets request for '/' (home directory), # respond with ... (string/HTML) # PARAMS: query parameters...
# Problem 122: Efficient exponentiation # http://projecteuler.net/problem=122 # The most naive way of computing n^15 requires fourteen multiplications: # n ×n × ... ×n = n^15 # But using a "binary" method you can compute it in six multiplications: # n ×n = n^2n^2×n^2 = n^4n^4×n^4 = n^8n^8×n^4 = n^12n^12×n^2 = n^14n^14...
require 'test_helper' class BeersControllerTest < ActionController::TestCase def setup @beer = beers(:carlton) end test "should get new beer" do get :new assert_response :success end test "should redirect beer edit when not logged in" do get :edit, id: @beer assert_not flash.empty? ...
require 'spec_helper' describe 'envconsul::install' do context 'zip file' do let(:params) { { :file_name => 'file.zip' } } it { is_expected.to contain_exec('unpack') .with( :command => 'unzip -o /tmp/file.zip') } end context 'tar.gz file' do let(:params) { { :file_name => 'file.tar.gz...
class User < ApplicationRecord before_save { self.email.downcase! } validates :name, presence: true em_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i validates :email, presence: true, length: { maximum: 255 }, format: { with: em_regex }, uniqueness...
require 'rails_helper' RSpec.describe Item, type: :model do before do @item = FactoryBot.build(:item) end describe '商品出品出来る時' do context 'ユーザー登録ができる時' do it '全ての項目が存在すれば出品できること' do expect(@item).to be_valid end end end context 'ユーザー登録ができない時' do it 'product_nameが空だと登録できない...
class BookCommentsController < ApplicationController before_action :authenticate_user! def create @book = Book.find(params[:book_id]) comment = current_user.book_comments.new(book_comment_params) comment.book_id = @book.id comment.save redirect_to book_path(@book) end def destroy # binding.pry BookC...
require_relative 'spec_helper.rb' describe IPMetric do include IPMetric it 'should give metric zero between an address and itself' do dist = ip_metric("192.168.0.34", "192.168.0.34") expect(dist).to eq(0) end it 'should give metric 1 between an address and neighbour' do dist = ip_metric("192.168.0....
class Wines::VarietyPercentage < ActiveRecord::Base include Wines::WineSupport belongs_to :detail, :foreign_key => 'wine_detail_id' belongs_to :variety delegate :name_zh, :to => :variety delegate :name_en, :to => :variety delegate :origin_name, :to => :variety def self.build_variety_percentage(variety_...
class User < ActiveRecord::Base has_many :waves validates :username, presence: true validates :password, presence: true, confirmation: true end
module Commands class Stack SYNONYMS = ['stack'] def self.keys SYNONYMS end def execute(repl = nil) repl.notice(repl.calculator.stack) end end end
Vagrant.configure("2") do |config| config.vm.box = "berchev/bionic64" # Adding .terraformrc file from Host to Guest for authentication to TF Cloud config.vm.provision :file, source: "~/.terraformrc", destination: "/home/vagrant/.terraformrc" config.vm.provision :shell, path: "scripts/terraform-sentinel.sh" end
require 'test_helper' # RoadmapDetailのモデルテスト class RoadmapDetailTest < ActiveSupport::TestCase def setup @roadmap_header = roadmap_headers(:ruby) @roadmap_detail = @roadmap_header.build_roadmap_detail(sub_title: "First rails", pic_pass1: "", pic_pass2: "", pic_pass3: "", pic_pass4: "", time_required: 20, tim...
module OfficeAutomationInvoice class Tax include Mongoid::Document ## Fields field :name field :value, type: Float ## Validations validates :name, presence: true, uniqueness: true validates :value, numericality: { greater_than: 0.1, less_than: 100.0 } ## Relationships has_and_be...
# Given the hash below flintstones = { "Fred" => 0, "Wilma" => 1, "Barney" => 2, "Betty" => 3, "BamBam" => 4, "Pebbles" => 5 } # Turn this into an array containing only two elements: Barney's name and Barney's number p flintstones flintstones = flintstones.to_a[2] p flintstones # Maybe we don't know the position ...
module Brewery class AuthCore::UserMailer < ActionMailer::Base default from: "from@example.com" def welcome_after_signup(user) @user = user mail(to: user.email, subject: I18n.t('user.mailer.welcome_after_signup.subject', app_name: I18n.t('global.app_name'))) do |format| format...
require_relative '../lib/month' RSpec.describe Month do context ".header" do it "matches cal for December 2012" do month = Month.new(12,2012) month.header.should == "December 2012".center(20) end it "matches cal for July 1901" do month = Month.new(7,1901) month.header.should == "Ju...
module Tephue module Entity # Represents a user class User include Entity::Comparable include Entity::Validatable define_schema do required(:id) { none? | int? } required(:email) { str? & format?(/^[^@\s]+@[^@\s]+$/) } required(:password_hash) { str? & format?(/^[0...
class CreateMiscIngredients < ActiveRecord::Migration def change create_table :misc_ingredients do |t| t.string :description t.date :order_date t.date :delivery_date t.string :material t.integer :item_id t.integer :pieces t.timestamps end end end
class ProjectsController < ApplicationController def index @projects = Project.all @q = Project.ransack(params[:q]) @searched_projects = @q.result(distinct: true) end def new @project = Project.new end def create @project = Project.new(project_params) if @project.save redirect_to projects_path ...
# ================================================================================ # Part: # Desc: # ================================================================================ class Package include Mongoid::Document include Mongoid::Timestamps # ...
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' class Metasploit3 < Msf::Exploit::Remote ...
require 'fileutils' require 'open3' module Patch class File attr_reader :path def initialize(path) @path = path end def apply(src_dir) data = ::File.read(@path) cmd = [Utils.patch_prog, '--strip=1', '--verbose', '-l'] Open3.popen2e(*cmd, :chdir => src_dir) do |cin, cout, w...
#!/usr/bin/env ruby =begin /* * BF2A -- Optimizing Brainfuck Compiler * usage: * ruby bf2a.rb program.b [output.c] * * Version 0.2 * * Copyright (c) 2005 Jannis Harder * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "S...
require 'docopt' require 'yavm/stores' module YAVM class CommandLine def initialize @invocation = File.basename($0) end def invoke! @args = Docopt::docopt(doc) command = @args.select { |a, v| commands.include?(a) && v }.keys.first command = 'show' if command.nil? ver...
# Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do factory :contact_form do subject "MyString" from "MyString" to "MyString" state "MyString" body "MyString" end end
# Written by Samuel Burns Cohen # Jan 24, 2019 # # Parser.rb # # This file defines the Parser class require_relative '../Components/Token' require_relative 'Tokenizer' require_relative '../Models/SymbolTable' class Parser public def initialize(text, error_handler) @error_handler = error_handler ...
## # Hérite de Grille jeu, permet de charger une sauvegarde ## # * +data+ Les éléments dans le fichier de la sauvegarde class Grille_jeu_charger < Grille_jeu private_class_method :new ## # Déclaration de la méthode creer qui renvoie vers la méthode new ## # * +estJouable+ boolean po...
# frozen_string_literal: true module Playlists # Show playlists service class ShowPlaylistsService < BaseService def call OpenStruct.new(playlists: policy_scope(Playlist)) end end end
class College < ActiveRecord::Base belongs_to :foundation has_many :courses has_many :students has_many :parameters end
class Passenger < ApplicationRecord has_many :trips validates :name, presence: true validates :phone_num, presence: true def total_cost total = self.trips.sum { |trip| trip.cost } / 100 return total end end
module DemoData class Vendors < ModelCollection api_path :vendors attr_reader :owner def initialize( count ) super() @owner = @data.reject!{ |v| "DEMO" == v.code }.first @pymnt_gl_id = DemoData.gl.find{|gl| gl.number=='2200' }.id ensure_reco...
require 'test/unit' require 'test/unit/testsuite' require 'test/unit/ui/console/testrunner' require 'test/unit/assertions' require 'watir-webdriver' require 'json' require 'rest-client' require 'date' include Test::Unit::Assertions require '../Pages/Admin/AdminLoginPage.rb' require '../Pages/FrontEnd/FrontEndHomePage...
# frozen_string_literal: true require 'rails_helper' RSpec.describe 'Organizations', type: :request do let(:user) { create(:user) } let(:admin) { create(:admin) } describe 'GET /organizations' do it 'works! (now write some real specs)' do get '/organizations' expect(response).to have_http_statu...
class CreateDeviceAssignments < ActiveRecord::Migration def change create_table :device_assignments do |t| t.integer :device_id t.integer :patient_id t.integer :location_id t.date :start_date t.date :end_date t.date :returned_date t.integer :monitor_length t.times...
# Create network script to add iptables require 'erubis' directory '/etc/network/if-pre-up.d' do action :create recursive true end directory '/etc/iptables' do action :create end template '/etc/network/if-pre-up.d/iptablesload' do action :create mode 0700 variables ({ :iptables_v4_file => node['base'...
require_relative 'test_helper' module ACRONYM end class Project def self.bo0k Bo0k end end class Book class TableOfContents; end def tableof_contents TableofContents end class Page def tableof_contents TableofContents end def self.tableof_contents TableofContents en...
json.messages @messages.each do |message| json.name message.user.name json.date message.time json.image message.image json.id message.id json.text message.text end
require_relative 'monster_name_generator.rb' class MonsterNameGenerator POSSIBLE_NAME = ['pikachu', 'kurama', 'parjo'] @instance = new private_class_method :new def self.instance @instance end def generate idx = rand(POSSIBLE_NAME.size) return POSSIBLE_NAME[idx] end end
#!/usr/bin/env ruby require "nokogiri" require "httparty" URL = "http://en.wikipedia.org/wiki/Facebook_statistics" # Fetch and parse the page html = HTTParty.get(URL).body dom = Nokogiri::HTML(html) # Get the main table table = dom.css("table.wikitable").first # [1..-1] skips the header row rows = table.css("tr")[1...
# frozen_string_literal: true class Article < ActiveRecord::Base belongs_to :course keep_running_count( :course, counter_column: "published_article_count", if: proc { |model| model.try(:published?) }, sql: ["articles.published = true"], ) end
class EssaySolutionsController < ApplicationController before_action :set_essay_solution, only: %i[ show edit update destroy ] # GET /essay_solutions or /essay_solutions.json def index @essay_solutions = EssaySolution.all end # GET /essay_solutions/1 or /essay_solutions/1.json def show end # GET ...
# frozen_string_literal: true require 'forwardable' require 'sidekiq' require 'sidekiq/manager' require 'sidekiq/api' module Sidekiq module LimitFetch autoload :UnitOfWork, 'sidekiq/limit_fetch/unit_of_work' require_relative 'limit_fetch/instances' require_relative 'limit_fetch/queues' require_rela...
class Integer def in_words(recursive=false) case self.to_s when /\b0\b/ then "zero" unless recursive when /\b\d\b/ then UNIT[self] when /\b1\d\b/ then TEENS[self] when /\b\d{2}\b/ tens = self.floor(-1) "#{TENS[tens]} #{(self-tens).in_words(true)}".rstrip w...
require_relative './helper.rb' describe 'AssetsHelpers' do context 'for #stylesheet_link_tag method' do it 'should display stylesheet link item using' do time = stop_time_for_test expected_options = {:media => "screen", :rel => "stylesheet", :type => "text/css"} app.css('style').sho...
RSpec.describe Localization do let(:valid_key) { :mission_plan } let(:valid_rich_key) { :travel_distance } let(:invalid_locale) { :en_BR } let(:locale) { :en_US } describe 'get_localized_string' do context 'when the locale is valid' do it 'returns the string based on the locale' do localiza...
module BrowseHelper def link_to_page(page, page_param) return link_to(page, page_param => page) end def printable_name(object, version=false) name = t 'printable_name.with_id', :id => object.id.to_s if version name = t 'printable_name.with_version', :id => name, :version => object.version.to_...
# frozen_string_literal: true class Analysis::FormatResponse include ::Interactor def call context.analysis = format_response end private def format_response { text: context.text, romanized: romanize(context.text), translation: context.translation, tokens: format_tokens(con...
class CommentsController < ApplicationController before_filter :authenticate_with_token, :except => [:comments_of_friend] before_filter :authenticate_friend, :only => [:comments_of_friend] def index friend = Friend.find_by_email(params[:friends_email]) conditions = { :resource_type => params[:resour...
require 'rails_helper.rb' require_relative '../../db/migrate/20180326220423_move_message_transfer_marker_to_marker_type' describe MoveMessageTransferMarkerToMarkerType do let(:user) { create :user } let(:client) { create :client, users: [user] } after do ActiveRecord::Migrator.migrate Rails.root.join('db', ...
require 'rdf/blazegraph' require 'rdf' module ScholarsArchive class TripleStoreException < StandardError end class TripleStore attr_reader :client, :url ## # @param [String] url # The full URL to the triplestore, ie. http://servername.hostname/blazegraph/namespace/production/sparql def in...
if Rails.env.production? || Rails.env.staging? raise "MEURIO_ACCOUNTS_URL is missing" if ENV['MEURIO_ACCOUNTS_URL'].nil? raise "MEURIO_HOST is missing" if ENV['MEURIO_HOST'].nil? raise "MEURIO_API_TOKEN is missing" if ENV['MEURIO_API_TOKEN'].nil? raise "POKE_TASK_TYPE_ID is missing" if ENV['POKE_TASK_TYPE_ID']....
# encoding: UTF-8 module API module Helpers module V1 module CitiesHelpers extend Grape::API::Helpers include EducationalInstitutionsHelpers def serialized_city(city, options = {}) options = { serializer: :city }.merge(options) serialized_object(city, options)...
Clickatellsend.config do |config| config.url = "http://api.clickatell.com/" config.user = ENV['CLICKATELL_USER'] config.password = ENV['CLICKATELL_PASSWORD'] config.api_id = ENV['CLICKATELL_API_ID'] end
# frozen_string_literal: true # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including withou...
# frozen_string_literal: true class AnswerTextarea < ApplicationRecord belongs_to :answer belongs_to :textarea end
require 'rails_helper' RSpec.describe Item, type: :model do before do @item = FactoryBot.build(:item) end describe '商品出品' do context '商品出品がうまくいくとき' do it 'nameとimageとinformationとcategory_idとstate_idとshipping_burden_idとshipper_prefecture_idとshipping_days_idとpriceが存在していれば保存できること' do expect(@...
class CreateMusicalStylePreferencesReceptions < ActiveRecord::Migration def change create_table :musical_style_preferences_receptions do |t| t.integer :reception_id, index: true t.integer :musical_style_preference_id end add_index :musical_style_preferences_receptions, :musical_style_preferen...
class Widget < ActiveRecord::Base has_many :features belongs_to :user accepts_nested_attributes_for :features validates_uniqueness_of :title validates_presence_of :user_id end
# frozen_string_literal: true class DropRoles < ActiveRecord::Migration[6.1] def up drop_table :roles end def down raise ActiveRecord::IrreversibleMigration end end
class ProjectsController < ApplicationController before_action :find_project, only: [:show, :edit, :update, :destroy] before_action :authenticate_user!, except: [:index, :show, :index_posts] # def index # if params[:category].blank? # @projects = Project # .where.not(category: 8) # .where.not(categ...
# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.define "kafka" do |kafka| kafka.vm.box = "ubuntu/trusty64" kafka.vm.hostname = "kafka" kafka.vm.provider "virtualbox" do |vb| # Customize the amount of memory on the VM: vb.memory = "2048" end kafka...
class PostsController < InheritedResources::Base load_and_authorize_resource respond_to :html respond_to :rss, only: :index helper_method :post, :posts, :person def post resource end def posts collection end protected def collection if params[:person_id] Post.on_person(params[:pe...
require "json" require "money" require "money/bank/google_currency" class BudgetYourTrip def self.get_country_average_costs(country) url = URI.parse("http://www.budgetyourtrip.com/api/v3/costs/country/" + country) request_country_info(url) end def self.get_cost_categories url = URI.parse("http://w...
# == Schema Information # # Table name: recipeingredients # # id :integer not null, primary key # recipe_id :integer # ingredient_id :integer # quantity :integer # ingredientunit_id :integer # created_at :datetime not null # updated_at :datetime ...
require 'spec_helper' require 'pogoplug/client' describe PogoPlug::Client do before do @client = PogoPlug::Client.new("https://service.pogoplug.com/", Logger.new(STDOUT)) @username = "gem_test_user@mailinator.com" @password = "p@ssw0rd" end context "#version" do it "should provide version info"...
require 'rails_helper' RSpec.describe RemoteObjectUpdaterJob, type: :job do describe '#perform_later' do it 'should enqueue an ActiveJob' do expect { create(:notification_protocol_update) }.to enqueue_a(RemoteObjectUpdaterJob) end context 'Protocol update', sparc_api: :get_protocol_1 do b...
require 'usiri/mwisho' module Muhakikisha extend self def siri s not s.empty? end def urefu u u.match? REGEX[:urefu] end def toleo t t.match? REGEX[:toleo] end end
require "files/path" module SpecRunner RSpec.describe(Path) do it "returns the file extension" do expect(described_class.new("/app/user.clj").file_extension) .to eq(".clj") expect(described_class.new("/app/user.rb").file_extension) .to eq(".rb") end end end
class Vote < ApplicationRecord belongs_to :user belongs_to :votable, polymorphic: true validates_uniqueness_of :user_id, scope: [:votable_id, :votable_type] validates :rating, numericality: { greater_than: -2, less_than: 2 } end
Given /^I am on the "(.*)" page$/ do |page| if (page != "log_in") visit "/sessions/new" fill_in 'email', :with => "test_user" fill_in 'password', :with => "abcd" click_button 'Login' end case page when "log_in" visit log_in_path when "home" visit root_path else visit ...
require 'qbwc' require 'concerns/qbwc_helper' class OrderPushWorker < QBWC::Worker include QbwcHelper #Was asked to send Amazon DF orders direct to invoice. This naming convention is misleading WorkerName = "OrderPushWorker" def requests(job) { :invoice_add_rq => { :xml_attribu...
class Vitola < ApplicationRecord has_many :package def total_count bsize*bcount*multiplier end end
class Api::ApplicationController < ApplicationController skip_before_action :authenticate_user! before_action :check_format protected def check_format unless params[:format] == 'json' || request.headers["Accept"] =~ /json/ render json: {message: t('controllers.api.format_not_acceptable')}, st...
Gem::Specification.new do |spec| spec.name = 'simple_youtube' spec.version = '1.0.3' spec.authors = ['James Shipton'] spec.email = ['ionysis@gmail.com'] spec.homepage = 'http://github.com/ionysis/simple_youtube' spec.summary = 'ActiveResource extension to Youtube API gdata.' sp...
RSpec.shared_examples "a schema" do |schema| it "matches a #{schema} schema" do expect(response.body).to match_schema(schema) end end
# frozen_string_literal: true class MockDbConnection def connection MockConnector.new end end
module Kickstarter module Campaigns class BuildNewCampaignsScrapingReportJob < ApplicationJob queue_as :reports_builders def perform(campaigns_ids, options = {}) report_data = Reporters::Slack::BuildNewCampaignsScrapingReportService.new(campaigns_ids).call Reporters::Slack::SendNewCam...
class AuthorsController < ApplicationController before_action :set_author, only: :show before_action :authenticate_customer!, only: [:new, :create, :edit, :update] before_action :check_access, only: [:new, :edit, :create, :update] def edit set_author end def new @author = Author.new end def u...
require 'spec_helper' describe Feature do let(:feature){Factory(:feature)} describe 'Validations' do context 'Feature is valid' do it 'with all the attributes' do feature.should be_valid end it 'without description' do feature.description = nil feature.should be_val...
class CreateTableCourseElectiveGroups < ActiveRecord::Migration def self.up create_table :course_elective_groups do |t| t.string :name t.integer :parent_id t.string :parent_type t.boolean :is_deleted, :default => false t.date :end_date t.boolean :is_sixth_subject, :default...
require 'rails_helper' RSpec.describe "Locations", :type => :request do describe "GET /locations" do context "API" do before :each do get "/locations", {}, { "Accept" => "application/json" } end let(:body) { JSON.parse(response.body) } it "works!" do expect(re...
require 'dnssd' require 'timeout' require 'json' require 'ostruct' require 'net/http' module BrewSparkling module Gateway class Xcode class ConnectionError < StandardError end class << self def availables(&f) timeout 1 do DNSSD.resolve! 'SparklingHelper','_http._t...
# frozen_string_literal: true module Kafka class LZ4Codec def codec_id 3 end def produce_api_min_version 0 end def load require "extlz4" rescue LoadError raise LoadError, "using lz4 compression requires adding a dependency on the `extlz4` gem to your Gemfile." en...
class SearchTable < ApplicationRecord def self.searchcategory(options = {}) category_suggestions = Category.where("lower(name) LIKE ?", "#{options[:queryString]}%").limit(50) category_suggestions.any? ? category_suggestions : false end def self.searchsubcategory(options = {}) subcategory_suggestions...
# frozen_string_literal: true require 'json' require 'tmpdir' require 'webmock/rspec' require_relative '../../assets/lib/commands/in' describe Commands::In do def git_dir @git_dir ||= Dir.mktmpdir end def git_uri "file://#{git_dir}" end let(:dest_dir) { Dir.mktmpdir } def get(payload) paylo...
# frozen_string_literal: true require 'client' describe 'レート取得' do before(:example) do @client = Jiji::Client.instance end it 'GET /rates/range で保持しているレートの範囲を取得できる' do r = @client.get('/rates/range') expect(r.status).to eq 200 expect(r.body['start']).not_to be nil expect(r.body['end']).not_...
class BooksController < ApplicationController skip_before_action :authorize, only: :index def index render json: Book.all end end
class CreateContractPaymentsPaymentScopes < ActiveRecord::Migration def change create_table :contract_payments_payment_scopes do |t| t.references :contract_payment, index: true, foreign_key: true t.references :payment_scope, index: true, foreign_key: true t.timestamps null: false end end end
module Backup module Adapters class PostgreSQL < Backup::Adapters::Base attr_accessor :user, :password, :database, :skip_tables, :host, :port, :socket, :additional_options private # Dumps and Compresses the PostgreSQL file def perform log system_messages[:pgdump]; l...
module CWS class App def self.instance @instance ||= Rack::Builder.new do use Rack::Cors do allow do origins '*' # add additional methods as needed for post, put, delete and options resource '*', headers: :any, methods: [:get,:post,:put,:delete,:options]...
class SubTopicsController < ApplicationController def index @sub_topics = SubTopic.all.page(params[:page]).per 20 end def show @sub_topic = SubTopic.find params[:id] end end
class Event < ActiveRecord::Base belongs_to :user validates_presence_of :title validates_presence_of :location validates_presence_of :date validates_presence_of :user enum privacy_status: [ :only_me, :invite, :everyone ] end
require "spec_helper" describe Activity do describe "#corrupt?" do context "trackable doesn't exist" do before do subject.stub(:trackable => nil) end its(:corrupt?) { should == true} end context "trackable exists" do before do subject.stub(:trackable => stub) ...
class ArticlesController < AuthenticatedController def new @article = Article.new(:user => current_user) end def create @article = current_user.articles.build(params[:article]) @article.publish = true if params[:publish] if @article.save redirect_to root_path, :notice => I18n.t(:'art...
# frozen_string_literal: true module V0 class HealthCareApplicationsController < ApplicationController FORM_ID = '1010ez' skip_before_action(:authenticate) before_action(:tag_rainbows) def create authenticate_token health_care_application = HealthCareApplication.new(params.permit(:form...