conversations
listlengths
2
3
source
stringclasses
1 value
stack
stringclasses
1 value
[ { "from": "system", "value": "Fix test for linked comment.\n" }, { "from": "human", "value": "When(/^I visit question page$/) do\n @question = FactoryGirl.create(:question)\n visit question_path(@question)\nend\n\nWhen(/^I fill out the comment form$/) do\n @comment_body = \"#{Faker::Lorem.par...
ruby
chosen
[ { "from": "system", "value": "Remove unit attribute from the initializer input\n" }, { "from": "human", "value": "module Atlas\n class InitializerInput\n include ActiveDocument\n\n DIRECTORY = 'initializer_inputs'\n\n attribute :query, String\n attribute :share_group, ...
ruby
chosen
[ { "from": "system", "value": "Refactor confusing 'more_opts' line in create_payment_method\n\nThis code was complicated because I was trying to handle the case where someone posts to\ncreate_payment_method without a 'credit_card' param. But that should be an error\nanyway, so why handle it?\n" }, { ...
ruby
chosen
[ { "from": "system", "value": "Revert \"No need for Rails 3 hack\"\n\nThis reverts commit 6e051d949a92d5245414d20a96fbcf918570c7ba.\n" }, { "from": "human", "value": "require \"active_record\"\nrequire \"groupdate/order_hack\"\nrequire \"groupdate/scopes\"\nrequire \"groupdate/series\"\n\nActiveR...
ruby
chosen
[ { "from": "system", "value": "Define Note in class comment\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\n# Note quacks like a placement, but requires a different set of construction arguments\n# - always has a pitch\n# - receives a voice and position if unspecified\ncla...
ruby
chosen
[ { "from": "system", "value": "Update to reflect latest version of RelaxDB\n" }, { "from": "human", "value": "require 'rubygems'\nrequire 'relaxdb'\n\nmodule Merb\n module RelaxDB\n \n class << self\n \n def connect\n set_database\n begin\n ::RelaxDB::Datab...
ruby
chosen
[ { "from": "system", "value": "Update css caching scheme again.\n" }, { "from": "human", "value": "# Fetches the css files from Chameleon so that it can be used by this extension.\n# The view layouts should be able to extract the uri from +CSS_URIS+\nCSS_URIS = []\nunless Rails.env.test?\n url =...
ruby
chosen
[ { "from": "system", "value": "Use public/system for Paperclip except in production\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nPaperclip::Attachment.default_options[:url] = \":s3_domain_url\"\nif Rails.env == \"test\" || ENV[\"CI\"]\n Paperclip::Attachment.default_option...
ruby
chosen
[ { "from": "human", "value": "Add spec documentation for new_relation\n" }, { "from": "gpt", "value": "require 'spec_helper'\nrequire_relative 'mocks/user_mock.rb'\n\ndescribe UserMock do\n\n describe 'new_relation' do\n\n it 'is a private method only because it not be used in your code only ...
ruby
chosen
[ { "from": "system", "value": "JariBakken: Return the yield result as well.\n\ngit-svn-id: aa1aa1384423cb28c2b1e29129bb3a91de1d9196@9557 07704840-8298-11de-bf8c-fd130f914ac9\n" }, { "from": "human", "value": "module Selenium\n module WebDriver\n class TargetLocator\n\n #\n # @api pr...
ruby
chosen
[ { "from": "human", "value": "Rename 'q_type' to 'type' in 'Questions' table\n" }, { "from": "gpt", "value": "class RenameQTypeToTypeInQuestionsTable < ActiveRecord::Migration\n def self.up\n \trename_column :questions, :q_type, :type\n end\n\n def self.down\n \trename_column :questions, :ty...
ruby
chosen
[ { "from": "system", "value": "Improve RailsEventStore::Event - a little Ruby magic\n\nIt is still the same RubyEventStore::Event as a base class.\nHowever with new RailsEventStore::Event you could:\n\n* Create new domain event easier:\n SomeEvent = Class.new(RailsEventStore::Event)\n ev = SomeEvent.new(na...
ruby
chosen
[ { "from": "system", "value": "Fix hidden budget investments restore feature\n\nAdd recursive restore option to restore all soft deleted relations.\n" }, { "from": "human", "value": "class Admin::HiddenBudgetInvestmentsController < Admin::BaseController\n include FeatureFlags\n\n has_filters %w...
ruby
chosen
[ { "from": "system", "value": "Add save_or_error!, validate_id methods and document ApplicationController helpers\n" }, { "from": "human", "value": "require 'deserializer/helper'\n\nclass ApplicationController < ActionController::API\n include Deserializer::Helper\n include Pundit\n\n force_ss...
ruby
chosen
[ { "from": "system", "value": "Create a valid reimbursement in sample\n\nThe current code is not creating a valid reimbursement since it's\ncreated when the associated order is still not in the riht state\n(paid and shipped).\n\nThe amount of the reimbursement was also wrong, since the return\nitem created h...
ruby
chosen
[ { "from": "system", "value": "Use sassc-compatible versions of neat and bourbon\n\nTo merge #936, we need to make sure we have a version of bourbon with\nhttps://github.com/thoughtbot/bourbon/commit/8257c683f8a250c06407f66d077dfbe6ce6595b0\nand a version of neat with\nhttps://github.com/thoughtbot/neat/comm...
ruby
chosen
[ { "from": "human", "value": "Add specs for IPv6 networking\n" }, { "from": "gpt", "value": "require 'spec_helper'\n\n# Check if IPv6 is disabled\ndescribe 'linux kernel parameters' do\n context linux_kernel_parameter('net.ipv6.conf.all.disable_ipv6') do\n its(:value) { should eq 1 }\n end\n...
ruby
chosen
[ { "from": "system", "value": "Set the private_key after authentication is enabled\n" }, { "from": "human", "value": "\ninclude_recipe 'jenkins::master'\n\n#\n# Setup\n# ------------------------------\n\n# Load the private key from a data bag item. This should be an encrypted data\n# bag item in ...
ruby
chosen
[ { "from": "system", "value": "Fix dynamic constant assignment offense\n" }, { "from": "human", "value": "class ManageIQ::Providers::Amazon::CloudManager::AuthKeyPair < ManageIQ::Providers::CloudManager::AuthKeyPair\n def self.raw_create_key_pair(ext_management_system, create_options)\n ec2 =...
ruby
chosen
[ { "from": "system", "value": "Add coverage for subprocess specs\n\nSince PR https://github.com/rubocop-hq/rubocop/pull/6255 the coverage results\nfrom the different suites (one per tested Ruby version) are merged together, and\nthe result is sent to Code Climate.\n\nThat means we no longer need to ignore co...
ruby
chosen
[ { "from": "system", "value": "Revert \"Wrap module LibC in XS\"\n\nThis reverts commit bddea962d3e17f4257a34ab02e3f9e80ee3697d8.\n" }, { "from": "human", "value": "# encoding: utf-8\n\nmodule XS\n module LibC\n extend FFI::Library\n # figures out the correct libc for each platform includi...
ruby
chosen
[ { "from": "system", "value": "Add error in tests if login fails\n" }, { "from": "human", "value": "module SpecFeatureHelper\n # if given a user, the password must be 'known' or given as a parameter\n # otherwise, the helper will create a user with a given password\n # returns the user it logs...
ruby
chosen
[ { "from": "system", "value": "Clean up inclusion migration script\n" }, { "from": "human", "value": "class CreateInclusions < ActiveRecord::Migration\n def change\n create_table :inclusions do |t|\n t.references :parent\n t.references :child\n\n t.timestamps null: false\n e...
ruby
chosen
[ { "from": "human", "value": "Migrate join-request activities to new format\n" }, { "from": "gpt", "value": "class MigrateJoinedActivityToAccepted < ActiveRecord::Migration\n def up\n RecentActivity.where(:key => 'space.join').each do |act|\n puts \"Converting :join activity to :accept i...
ruby
chosen
[ { "from": "human", "value": "Add script to set up labels in github\n" }, { "from": "gpt", "value": "require 'octokit'\n\ndry_run = false\ntoken = ''\nrepo_slug = ARGV.first\n\nunless repo_slug\n puts \"[!] A repo slug is required\"\nend\n\nputs \"Updating labels of `#{repo_slug}` repo\"\n\nLABE...
ruby
chosen
[ { "from": "system", "value": "Add a more descriptive gem description\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../lib\", __FILE__)\n\nrequire 'sinatra/asset_pipeline/version'\n\nGem::Specification.new do |gem|\n gem.name = \"sinatra-asset-pipeline\"\n gem.version = Sinat...
ruby
chosen
[ { "from": "human", "value": "Add acceptance test for kerberos master\n" }, { "from": "gpt", "value": "require 'spec_helper_acceptance'\n\ndescribe 'kerberos master' do\n\n context 'client with defaults' do\n it 'should idempotently run' do\n pp = <<-EOS\n class { 'kerberos':\n ...
ruby
chosen
[ { "from": "system", "value": "Add user factories with both E-ZBorrow and non E-ZBorrow statuses to the User factory\n" }, { "from": "human", "value": "# User factory\nFactoryGirl.define do\n factory :user do\n username 'developer'\n email 'developer@example.com'\n firstname 'Dev'\n ...
ruby
chosen
[ { "from": "system", "value": "Use same logging rules as ActiveRecord\n" }, { "from": "human", "value": "module Makara\n module Logging\n\n module Subscriber\n\n def sql(event)\n name = event.payload[:name]\n name = [current_wrapper_name(event), name].compact.join(' ')\n ...
ruby
chosen
[ { "from": "system", "value": "Add pre / post notifications\n" }, { "from": "human", "value": "## slack notification requires:\n# set :slack_channel\n# set :slack_team\n# set :slack_token\n# set :stage, \"production\"\n\nclass ShipistranoSlack\n require 'net/http'\n\n def self.post_to_slack(sla...
ruby
chosen
[ { "from": "human", "value": "Add ems_id and ems_ref fields to orchestration_template\n\nAdd ems_id and ems_ref fields to orchestration_template\n" }, { "from": "gpt", "value": "class AddEmsIdAndEmsRefToOrchestrationTemplates < ActiveRecord::Migration[5.0]\n def change\n add_column :orchestra...
ruby
chosen
[ { "from": "human", "value": "Create rake task to convert direct url references to paperclip attachments.\n" }, { "from": "gpt", "value": "desc 'Convert url references to paperclip attachments'\ntask :urls_to_paperclip, [:model_name, :url_field, :attachment_field] => :environment do |_, args|\n ...
ruby
chosen
[ { "from": "system", "value": "Add support for reload --provision\n" }, { "from": "human", "value": "require \"vagrant-ohai/version\"\nrequire \"vagrant/plugin\"\n\nraise RuntimeError, \"vagrant-ohai will only work with Vagrant 1.2.3 and above!\" if Vagrant::VERSION <= \"1.2.3\"\n\nmodule Vagrant...
ruby
chosen
[ { "from": "human", "value": "Add feature test for dashboard\n" }, { "from": "gpt", "value": "require \"test_helper\"\n\nclass DashboardTest < Capybara::Rails::TestCase\n test \"shows relevant information\" do\n visit root_path\n\n within '#most-recent' do\n assert_content page, \"50�...
ruby
chosen
[ { "from": "system", "value": "Move behavior into a method to avoid accessing ivars\n\nAccessing ivars is weird and the alternative (explicit self) is weirder.\nBy moving the behavior into a method, we can avoid both.\n" }, { "from": "human", "value": "module Protobuf\n module Rpc\n module Mi...
ruby
chosen
[ { "from": "system", "value": "Add test case when you do not have id.\n" }, { "from": "human", "value": "class TestResourceBase < Test::Unit::TestCase\n def setup\n stub(Yao::Resources::Base).get { Yao::Resources::Base.new({\"id\" => \"foor\", \"name\" => \"bar\"}) }\n end\n\n def test_frie...
ruby
chosen
[ { "from": "system", "value": "Delete spaces from UKRDC NHS numbers\n\nThere maybe be some patients with a space in their\nNHS number and this can causes issues at the UKRDC,\nso remove the spaces when generating the XML.\n" }, { "from": "human", "value": "# frozen_string_literal: true\n\nmodule ...
ruby
chosen
[ { "from": "system", "value": "Update pad array passes rspec\n" }, { "from": "human", "value": "# Pad an Array\n\n# I worked on this challenge [by myself, with: ]\n#andrea\n# I spent [] hours on this challenge.\n#1 hour\n\n# Complete each step below according to the challenge directions and\n# in...
ruby
chosen
[ { "from": "system", "value": "Remove redundant rescue blocks in TemplatesController\n" }, { "from": "human", "value": "class TemplatesController < ApplicationController\n respond_to :json\n\n def index\n respond_with Template.all\n end\n\n def show\n respond_with Template.find(params[:...
ruby
chosen
[ { "from": "system", "value": "Set container port to 3001 to not conflict with HTTPD\n" }, { "from": "human", "value": "class MiqRemoteConsoleWorker < MiqWorker\n require_nested :Runner\n\n self.required_roles = ['remote_console']\n\n RACK_APPLICATION = RemoteConsole::RackServer\n STARTING_PO...
ruby
chosen
[ { "from": "system", "value": "Check if a file exists before adding it to the releases hash\n" }, { "from": "human", "value": "class TsvReleasePresenter\n attr_reader :release\n\n def initialize(release)\n @release = release\n end\n\n def as_json(options = {})\n {\n note: release.p...
ruby
chosen
[ { "from": "system", "value": "Use our own slice_keys method for same effect.\n" }, { "from": "human", "value": "get '/v2/user' do\n only_for 'code.org'\n dont_cache\n forbidden! unless dashboard_user\n content_type :json\n JSON.pretty_generate(dashboard_user.slice(:id, :name))\nend\n\nget '...
ruby
chosen
[ { "from": "system", "value": "Remove test for behavior that no longer exists" }, { "from": "human", "value": "require 'spec_helper'\n\ndescribe StandardTasks::ReviewerReportTask do\n describe \"defaults\" do\n subject(:task) { StandardTasks::ReviewerReportTask.new }\n specify { expect(tas...
ruby
chosen
[ { "from": "system", "value": "Build the executables dynamically so that if a new executable is added it will be included in the gem build.\n\n### What\nBuild the executables included in the gem dynamically rather than hardcoding them.\n\n### Why\nI don't plan to add any new executables, but if I ever do it ...
ruby
chosen
[ { "from": "human", "value": "Add custom functions for determining some PE settings\n\nAdded a function to find the hostname and port of the classifier\n\nAdded a fucntion to return all puppetdb hostnames\n" }, { "from": "gpt", "value": "module Puppet::Parser::Functions\n newfunction(:puppet_mas...
ruby
chosen
[ { "from": "system", "value": "Return only used venues in /contests response\n" }, { "from": "human", "value": "json.array! @competitions do |c|\n json.id c.id.to_s\n json.name c.name\n json.time_zone c.host.time_zone.name\n json.start_date c.begins.to_time(:utc) - c.host.time_zone.utc_offset...
ruby
chosen
[ { "from": "system", "value": "Use SQL Service LIMIT syntax.\n" }, { "from": "human", "value": "require 'cases/sqlserver_helper'\nrequire 'models/event'\n\nclass FinderTestSqlserver < ActiveRecord::TestCase\nend\n\nclass FinderTest < ActiveRecord::TestCase\n \n COERCED_TESTS = [\n :test_exis...
ruby
chosen
[ { "from": "system", "value": "Add previous and next methods.\n" }, { "from": "human", "value": "module Blog\n class Article < ActiveRecord::Base\n include ::Commentable\n include ::FriendlyId\n include ::Posted\n\n belongs_to :blog, class_name: 'Blog::App'\n\n ...
ruby
chosen
[ { "from": "human", "value": "Enforce that specs executed through aruba features use the new `expect`\nsyntax\n" }, { "from": "gpt", "value": "if defined?(Cucumber)\n require 'shellwords'\n Before do\n set_env('SPEC_OPTS', \"-r#{Shellwords.escape(__FILE__)}\")\n end\nelse\n RSpec.configure...
ruby
chosen
[ { "from": "system", "value": "Add a few more specs for logger refinement\n" }, { "from": "human", "value": "require 'everything'\nrequire './lib/everything/add_logger_to_everything_refinement'\n\ndescribe Everything do\n context 'when using the refinement' do\n using Everything::AddLoggerToE...
ruby
chosen
[ { "from": "system", "value": "Add options value to storage handler interface\n" }, { "from": "human", "value": "require 'casa-payload'\nrequire 'casa-publisher/persistence/payload_validation_error'\n\nmodule CASA\n module Publisher\n module Persistence\n class MemoryStorageHandler\n\n ...
ruby
chosen
[ { "from": "system", "value": "fix(zipcode): Fix zipcode in Rails 4+\n\nClose #19\n" }, { "from": "human", "value": "class Zipcode < ActiveRecord::Base\n belongs_to :county\n belongs_to :state\n\n validates :code, uniqueness: true, presence: true\n validates :state_id, :county_id, :city, pres...
ruby
chosen
[ { "from": "system", "value": "Add reflection to guessing game\n" }, { "from": "human", "value": "# Build a simple guessing game\n\n\n# I worked on this challenge [by myself, with: ].\n# I spent [#] hours on this challenge.\n\n# Pseudocode\n\n# Input:\n# Output:\n# Steps:\n\n\n# Initial Solution\...
ruby
chosen
[ { "from": "system", "value": "Disable transaction block during migration\n" }, { "from": "human", "value": "class ChangeFingerprintIndexOnIdentity < ActiveRecord::Migration\n def self.up\n execute \"create index concurrently index_fingerprints_on_identities_with_gin on identities using gin(f...
ruby
chosen
[ { "from": "system", "value": "Add simple pub/sub functionality to FakeEventStore\n" }, { "from": "human", "value": "class FakeEventStore\n attr_reader :events, :published\n\n def initialize\n @published = []\n @streams = Hash.new { |hash, stream| hash[stream] = [] }\n end\n\n def publi...
ruby
chosen
[ { "from": "system", "value": "Use older version of sprockets\n" }, { "from": "human", "value": "# coding: utf-8\nGem::Specification.new do |spec|\n spec.name = \"sprockets-memcache-store\"\n spec.version = '0.0.4'\n spec.authors = [\"Alex MacCaw\"]\n spec.email =...
ruby
chosen
[ { "from": "system", "value": "Work around migration specs failing due to repository storages not being selected\n\nMigration specs may be missing a column necessary to create an ApplicationSetting\nobject, which causes the FakeApplicationSetting to be initialized. However, the\nproject selects a random repo...
ruby
chosen
[ { "from": "human", "value": "Add tests for aggregation state\n\nSigned-off-by: Lucas Moura <143f96f992bf3dc84afaa2cc3d6d759a2b3ef261@gmail.com>\nSigned-off-by: Johnnys Ribeiro <e28a8c0275ee127bd6f2bdac708244856a0a7106@gmail.com>\n" }, { "from": "gpt", "value": "require_relative '../../spec_helpe...
ruby
chosen
[ { "from": "system", "value": "Make sure the content type is decorated.\n" }, { "from": "human", "value": "module Concerns\n module Backend\n module ContentTypeController\n extend ActiveSupport::Concern\n\n included do\n layout 'backend/lightbox'\n before_action :find_...
ruby
chosen
[ { "from": "system", "value": "Improve spec nesting and description\n" }, { "from": "human", "value": "require 'rails_helper'\n\ndescribe Admin::SidebarController, type: :controller do\n let!(:blog) { create(:blog) }\n\n before do\n henri = create(:user, :as_admin)\n sign_in henri\n end\...
ruby
chosen
[ { "from": "system", "value": "Add context to post behaviour\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'uri'\n\ninclude Twingly::Analytics\n\ndescribe Result do\n it { should respond_to :posts }\n it { should respond_to :number_of_matches_returned }\n it { should respon...
ruby
chosen
[ { "from": "system", "value": "Include support files and directories\n" }, { "from": "human", "value": "$LOAD_PATH.unshift File.expand_path(\"../../lib\", __FILE__)\n\nrequire 'rspec'\nrequire 'webmock/rspec'\nrequire 'pp'\n\nrequire \"rsr_group\"\n\nroot = File.expand_path('../..', __FILE__)\nDi...
ruby
chosen
[ { "from": "system", "value": "Enable AWS stub mode for specs\n" }, { "from": "human", "value": "require 'capistrano/s3/publisher'\nrequire 'mocha/api'\n\nRSpec.configure do |config|\n config.mock_framework = :mocha\nend" }, { "from": "gpt", "value": "require 'capistrano/s3/publisher...
ruby
chosen
[ { "from": "system", "value": "Define factories in spec_hepler :(\n\nFor some reason, the factories defined in the dummy app are not\navailable in the test suite.\n" }, { "from": "human", "value": "ENV['RAILS_ENV'] ||= 'test'\n\nrequire File.expand_path(\"../dummy/config/environment.rb\", __FILE...
ruby
chosen
[ { "from": "system", "value": "Fix an issue that spec won't run when trying to run arbitrary spec file\n" }, { "from": "human", "value": "# coding: utf-8\n\nRSpec.configure do |config|\n # Yes, I'm writing specs in should syntax intentionally!\n config.expect_with :rspec do |c|\n c.syntax = ...
ruby
chosen
[ { "from": "system", "value": "Change spec helper to use new devtools spec helper\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'backports'\nrequire 'backports/basic_object' unless defined?(::BasicObject)\nrequire 'devtools'\nrequire 'ice_nine'\n\nDevtools.init_spec_helper\n\nif...
ruby
chosen
[ { "from": "system", "value": "Fix tests failure by requiring rspec/core instead of rspec.\n\nSigned-off-by: Alissa Bonas <fb6f204bea4868e5fad08a7576b6b090e7fa2b20@redhat.com>\n" }, { "from": "human", "value": "require 'rspec'\nrequire 'rspec/mocks'\nrequire 'rbovirt'\n\nmodule OVIRT::RSpec\n\n ...
ruby
chosen
[ { "from": "system", "value": "Fix long method call for 1.8.7\n" }, { "from": "human", "value": "$:.unshift File.expand_path(\"../..\", __FILE__)\n\nrequire 'lib/lxc'\n\ndef fixture_path(filename=nil)\n path = File.expand_path(\"../fixtures\", __FILE__)\n filename.nil? ? path : File.join(path, ...
ruby
chosen
[ { "from": "system", "value": "Change to remove ruby limit\n" }, { "from": "human", "value": "# encoding: utf-8\n\nif RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])\n require 'simplecov'\n require 'coveralls'\n\n SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[\n Sim...
ruby
chosen
[ { "from": "system", "value": "Remove byebug require for travis.\n" }, { "from": "human", "value": "require 'simplecov'\nSimpleCov.command_name \"Rspec\"\nSimpleCov.start\n\nrequire 'bundler/setup'\nBundler.setup\n\nrequire 'fat_core'\nrequire 'byebug'\n\n# This file was generated by the `rspec -...
ruby
chosen
[ { "from": "system", "value": "Add constraint on rake version\n\nIn order to fix an imcompatibility between rake 12 and rspec 2.\n" }, { "from": "human", "value": "# coding: utf-8\nlib = File.expand_path('../lib', __FILE__)\n$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)\nrequire 'spec_c...
ruby
chosen
[ { "from": "system", "value": "Add gif as a default supported file type.\n" }, { "from": "human", "value": "# Use this setup block to configure all options available in Anaconda.\nAnaconda.config do |config|\n config.aws = {\n aws_access_key: ENV[\"AWS_ACCESS_KEY\"] || nil,\n aws_secret_ke...
ruby
chosen
[ { "from": "system", "value": "Use a default batch_id in revalidate\n" }, { "from": "human", "value": "require \"alephant/broker/errors\"\n\nmodule Alephant\n module Broker\n module LoadStrategy\n module Revalidate\n class Fetcher\n include Logger\n\n attr_reader...
ruby
chosen
[ { "from": "system", "value": "Fix missing > in hash (thanks wkoziej)\n" }, { "from": "human", "value": "module Foreigner\n module ConnectionAdapters\n module PostgreSQLAdapter\n include Foreigner::ConnectionAdapters::Sql2003\n \n def foreign_keys(table_name)\n fk_info =...
ruby
chosen
[ { "from": "system", "value": "Fix serverspec to ignore http_proxy.\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'zabbix_client'\n\ndescribe service('httpd') do\n it { should be_enabled }\nend\n\ndescribe service('mysqld') do\n it { should be_enabled }\nend\n\ndescribe serv...
ruby
chosen
[ { "from": "system", "value": "Remove static attribute in store credit reason factory\n\nWe already converted the rest of the factories attributes to dynamic\ninto #2831 but after merging that PR, we merged #2798 which was pretty\nold and was still using the old \"way\".\n" }, { "from": "human", ...
ruby
chosen
[ { "from": "human", "value": "Support for opening URL from the UI through automate: add tests.\n" }, { "from": "gpt", "value": "describe ExternalUrlMixin do\n let(:test_class) do\n Class.new(ActiveRecord::Base) do\n def self.name; 'TestClass'; end\n self.table_name = 'vms'\n in...
ruby
chosen
[ { "from": "system", "value": "Increase the wait time for the locale selector\n\nThis reduces flaky test failures.\n" }, { "from": "human", "value": "module PageTransitionSupport\n def change_language(languageCode)\n within 'select[name=locale]' do\n find(\"option[value=#{languageCode}]\...
ruby
chosen
[ { "from": "system", "value": "Simplify interaction group management within Interface\n" }, { "from": "human", "value": "require \"rspec/contracts/interaction\"\nrequire \"rspec/contracts/interaction_group\"\n\nmodule RSpec\n module Contracts\n class Interface\n attr_reader :name\n\n ...
ruby
chosen
[ { "from": "system", "value": "Implement policy creation for stacks\n" }, { "from": "human", "value": "require 'sfn'\n\nmodule Sfn\n class Callback\n class StackPolicy < Callback\n\n # @return [Smash] cached policies\n attr_reader :policies\n\n # Overload to init policy cache\n...
ruby
chosen
[ { "from": "human", "value": "Include snapshot list unit test\n\nThis commit introduces a new set of unit tests for the snapshot list\ncommand.\n" }, { "from": "gpt", "value": "require File.expand_path(\"../../../../../base\", __FILE__)\n\nrequire Vagrant.source_root.join(\"plugins/commands/snaps...
ruby
chosen
[ { "from": "system", "value": "Add attribute readers to mock message\n\nThis adds public access for payload, delivery_info and headers on\nmock message instances. This is helpful for tests using the mock\nmessage class and have expectations based on these attributes.\n" }, { "from": "human", "val...
ruby
chosen
[ { "from": "human", "value": "Migrate existing RateDetails -- connect them to chargeable_fields\n\nThis is needed mainly for custom user-create chargeback_rate_details to\nget right field assigned.\n\nPart of #13375.\n" }, { "from": "gpt", "value": "class ExtractFieldDataFromRateDetail < ActiveRe...
ruby
chosen
[ { "from": "system", "value": "Fix \"coveralls\" and \"simplecov\" require order\n" }, { "from": "human", "value": "require 'coveralls'\nrequire 'simplecov'\nrequire 'test/unit'\nrequire 'test/unit/rr'\n\nCoveralls.wear!\nSimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter\nSimpleCov.start\...
ruby
chosen
[ { "from": "system", "value": "Fix rubocop warning in TextualMixins::TextualScanHistory\n" }, { "from": "human", "value": "module TextualMixins::TextualScanHistory\n def textual_scan_history\n h = {:label => _(\"Analysis History\"), :icon => \"fa fa-search\"}\n num = @record.number_of(:sca...
ruby
chosen
[ { "from": "system", "value": "Use rails root instead of ../../../../\n" }, { "from": "human", "value": "require 'rails/generators'\nrequire 'rails/generators/migration'\n\nclass RailsSettingsGenerator < Rails::Generators::Base\n include Rails::Generators::Migration\n\n def self.source_root\n ...
ruby
chosen
[ { "from": "system", "value": "Use section attributes for confirm dialog builder section\n" }, { "from": "human", "value": "class Releaf::Builders::ConfirmDialogBuilder\n include Releaf::Builders::ResourceDialog\n\n attr_accessor :form\n\n def output\n tag(:section, class: classes) do\n ...
ruby
chosen
[ { "from": "human", "value": "Configure basic auth for LinkChecker from ENV\n\nThis is only necessary for integration environment.\n" }, { "from": "gpt", "value": "# This ENV var is only populated for the integration deployment environment.\nif ENV.has_key?(\"BASIC_AUTH_CREDENTIALS\")\n LinksChe...
ruby
chosen
[ { "from": "system", "value": "Fix bug with incorrect module name.\n" }, { "from": "human", "value": "module NameableRecord\n module ActiveRecordExtensions\n def self.included( base )\n base.extend ActsMethods\n end\n\n module ActsMethods\n def has_name( *args )\n unless included_m...
ruby
chosen
[ { "from": "system", "value": "[hephaestus] Remove reporter_id once document finish\n" }, { "from": "human", "value": "class DocumentProcessBootstrapTask\n @queue = :document_process_bootstrap\n\n def self.perform(document_id)\n document = Document.find(document_id)\n task_finder = TaskFi...
ruby
chosen
[ { "from": "system", "value": "Refactor Mobility::Backends::AR::QueryMethods using WhereChainable module\n" }, { "from": "human", "value": "module Mobility\n module Backends\n module ActiveRecord\n=begin\n\nDefines query method overrides to handle translated attributes for ActiveRecord\nmodel...
ruby
chosen
[ { "from": "system", "value": "Add spec for brand logo case when no user is signed in\n" }, { "from": "human", "value": "require 'spec_helper'\n\nRSpec.feature 'sign in' do\n let(:user) do\n user = Fabricate(\n :user,\n email: 'user@timeoverflow.org',\n password: 'papapa22',\n ...
ruby
chosen
[ { "from": "system", "value": "Use described_class in the specs.\n" }, { "from": "human", "value": "require 'spec_helper'\n\ntry_spec do\n require './spec/fixtures/api_user'\n\n describe DataMapper::TypesFixtures::APIUser do\n supported_by :all do\n subject { DataMapper::TypesFixtures::...
ruby
chosen
[ { "from": "system", "value": "Speed up tests with before :all (and add an after block that cleans up)\n" }, { "from": "human", "value": "require 'spec_helper'\nrequire 'earth/electricity/electric_utility'\n\ndescribe ElectricUtility do\n describe 'Electric utility data', :data_miner => true do\...
ruby
chosen
[ { "from": "system", "value": "Clean up configuration changes after custom template test\n" }, { "from": "human", "value": "describe Js::Routes::Rails::RouteExporter do\n let(:routes) { Rails.application.routes.routes }\n let(:finder) { Js::Routes::Rails::RouteFinder.new(routes) }\n subject { ...
ruby
chosen
[ { "from": "system", "value": "Add set of test data for a graph of dependencies spec\n\nAdd set of test data for a graph of dependencies spec\n" }, { "from": "human", "value": "module SpecParsedData\n def vm_data(i, data = {})\n {\n :type => ManageIQ::Providers::CloudManager::...
ruby
chosen
[ { "from": "system", "value": "Correct compiler JAR glob to not include SNAPSHOT suffix\n" }, { "from": "human", "value": "Pod::Spec.new do |s|\n s.name = 'WireCompiler'\n s.version = \"#{ENV['POD_VERSION']}\"\n s.license = { :type => 'apache2', :file => 'LICENSE.txt' }\n ...
ruby
chosen
[ { "from": "human", "value": "Create specs for pagarme_contributions service\n" }, { "from": "gpt", "value": "require 'rails_helper'\n\nRSpec.describe RecurringContribution::PagarmeSubscription do\n include RecurringContributionsHelper\n\n describe '#build' do\n let(:plan) { create(:plan, pl...
ruby
chosen
[ { "from": "system", "value": "Fix Summarization.new spec to kill mutation\n" }, { "from": "human", "value": "# encoding: utf-8\n\nrequire 'spec_helper'\n\ndescribe Algebra::Summarization, '.new' do\n subject { object.new(operand, summarize_per, summarizers) }\n\n let(:header) { [ [ :id, I...
ruby
chosen
[ { "from": "system", "value": "Fix parent class name in chunks controller\n" }, { "from": "human", "value": "class Api::ChunksController < ApplicationController\n before_action :set_chunk, only: [:show, :update, :destroy]\n \n def index\n @chunks = Chunk.all\n json_response(@chunks)\n e...
ruby
chosen