diff
stringlengths
65
26.7k
message
stringlengths
7
9.92k
diff --git a/checkin-service/spec/apis/redemptions_api_spec.rb b/checkin-service/spec/apis/redemptions_api_spec.rb index abc1234..def5678 100644 --- a/checkin-service/spec/apis/redemptions_api_spec.rb +++ b/checkin-service/spec/apis/redemptions_api_spec.rb @@ -7,10 +7,19 @@ describe RedemptionsApi do include Rack::Test::Methods - describe 'e.g. GET, POST, PUT, etc.' do - it 'needs tests to be written!' do - pending('write tests for RedemptionsApi!') - end - end + context "POST /redemptions" do + + let(:ash) { User.create!(name:"Ash Ketchum", email: "ash@oaklab.com") } + let(:store) { Location.create!(store_name: "711") } + let(:coffee_reward) { Reward.create!(name: "free coffee", point_value: 2) } + + it 'redeems points for a reward' do + Checkin.check_in(ash.id, store.id, 5) + p points = Checkin.points(ash.id, store.id) + redemptions = [{ user_id: ash.id, location_id: store.id, reward_id: 1 } ] + post "/redemptions", redemptions.to_json, 'CONTENT_TYPE' => 'application/json' + expect(last_response.body).to eq(201) + end + end end
Add first test for redemption api
diff --git a/Casks/firefox-aurora.rb b/Casks/firefox-aurora.rb index abc1234..def5678 100644 --- a/Casks/firefox-aurora.rb +++ b/Casks/firefox-aurora.rb @@ -1,8 +1,8 @@ class FirefoxAurora < Cask - version '35.0a2' - sha256 'c27899ebdb9d3b44ccac8ad904a03b421b65208e66937c62d795aab1d0014999' + version :latest + sha256 :no_check - url "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/firefox-#{version}.en-US.mac.dmg" + url "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora/firefox-35.0a2.en-US.mac.dmg" homepage 'https://www.mozilla.org/en-US/firefox/aurora/' license :oss
Remove sha check and version from FirefoxAurora Sha is likely to change without notice even for the same dmg filename (was currently broken because of this)
diff --git a/test/bank-account-statement/outputs/OFX/base_test.rb b/test/bank-account-statement/outputs/OFX/base_test.rb index abc1234..def5678 100644 --- a/test/bank-account-statement/outputs/OFX/base_test.rb +++ b/test/bank-account-statement/outputs/OFX/base_test.rb @@ -1,4 +1,5 @@ require 'bigdecimal' +require 'yaml' require_relative '../../../test_helper' require_relative '../../../../lib/bank-account-statement/outputs'
Fix test Outputs::OFX missing require.
diff --git a/Library/Formula/exult.rb b/Library/Formula/exult.rb index abc1234..def5678 100644 --- a/Library/Formula/exult.rb +++ b/Library/Formula/exult.rb @@ -1,32 +1,31 @@ require 'formula' -# TODO we shouldn't be installing .apps if there is an option +class Exult <Formula + head 'http://exult.svn.sourceforge.net/svnroot/exult/exult/trunk', + :revision => '6317' + homepage 'http://exult.sourceforge.net/' -class Exult <Formula - # Use a specific revision that is known to compile (on Snow Leopard too.) - head 'http://exult.svn.sourceforge.net/svnroot/exult/exult/trunk', :revision => '6128' - homepage 'http://exult.sourceforge.net/' - depends_on 'sdl' depends_on 'sdl_mixer' - + depends_on 'libvorbis' + aka 'ultima7' - + def install # Yes, really. Goddamnit. inreplace "autogen.sh", "libtoolize", "glibtoolize" - + system "./autogen.sh" system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--disable-sdltest" - + system "make" system "make bundle" prefix.install "Exult.app" end - + def caveats; "Cocoa app installed to #{prefix}\n\n"\ "Note that this includes only the game engine; you will need to supply your own\n"\
Update Exult and use vorbis.
diff --git a/Casks/lastpass-universal.rb b/Casks/lastpass-universal.rb index abc1234..def5678 100644 --- a/Casks/lastpass-universal.rb +++ b/Casks/lastpass-universal.rb @@ -0,0 +1,8 @@+class LastpassUniversal < Cask + url 'https://lastpass.com/lpmacosx.dmg' + homepage 'https://lastpass.com/' + version '2.5.0' + sha1 '0efa71f9b5efb9b4bed2574025eb9c0bedc1eada' + install 'lpmacosx.pkg' + uninstall 'LastPass Uninstall.app' +end
Add Cask for LastPass Universal Mac OS X This patch adds support for the LastPass Universal Installer for Mac, which is a .dmg containing all of the LastPass browser extensions.
diff --git a/core/db/migrate/20130319082943_change_adjustments_amount_precision.rb b/core/db/migrate/20130319082943_change_adjustments_amount_precision.rb index abc1234..def5678 100644 --- a/core/db/migrate/20130319082943_change_adjustments_amount_precision.rb +++ b/core/db/migrate/20130319082943_change_adjustments_amount_precision.rb @@ -0,0 +1,7 @@+class ChangeAdjustmentsAmountPrecision < ActiveRecord::Migration + def change + + change_column :spree_adjustments, :amount, :decimal, :precision => 10, :scale => 2 + + end +end
Change in amount precision for spree adjustments Fixes #2715 Fixes #2716
diff --git a/db/data_migration/20161206120331_remove_stats_dataset_relationship.rb b/db/data_migration/20161206120331_remove_stats_dataset_relationship.rb index abc1234..def5678 100644 --- a/db/data_migration/20161206120331_remove_stats_dataset_relationship.rb +++ b/db/data_migration/20161206120331_remove_stats_dataset_relationship.rb @@ -2,5 +2,5 @@ # which is superseded and has the slug 'average-house-prices' # so assume this is a bad relationship and disconnect the two. pub = Publication.find(392444) -pub.statistical_data_sets.select! { |ds| ds.id != 14779 } -pub.save! +data_set = StatisticalDataSet.find(14779) +pub.statistical_data_sets.delete(data_set)
Remove relationship to stats data set This DfT publication has an association to a statistical data set from DCLG on a completely irrelevant subject. We're assuming this is not intended. The data set is also superseded so remove the relationship.
diff --git a/big_decimal_helper.gemspec b/big_decimal_helper.gemspec index abc1234..def5678 100644 --- a/big_decimal_helper.gemspec +++ b/big_decimal_helper.gemspec @@ -15,6 +15,7 @@ gem.require_paths = ["lib"] gem.version = BigDecimalHelper::VERSION + gem.add_development_dependency 'rake', '~> 0.9.2.2' gem.add_development_dependency 'rspec', '~> 2.11.0' gem.add_development_dependency 'nyan-cat-formatter' end
Add Rake to development dependencies so Bundler doesn't freak out
diff --git a/Casks/eclipse-jee-kepler.rb b/Casks/eclipse-jee-kepler.rb index abc1234..def5678 100644 --- a/Casks/eclipse-jee-kepler.rb +++ b/Casks/eclipse-jee-kepler.rb @@ -3,8 +3,12 @@ sha256 'd18c5b4249a782a36c2d7bb377871393acd5dd552a195fc49b5b944f04874fbf' url 'http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/kepler/SR2/eclipse-jee-kepler-SR2-macosx-cocoa-x86_64.tar.gz' + name 'Eclipse' + name 'Eclipse IDE for Java EE Developers' homepage 'https://eclipse.org' - license :oss + license :eclipse + depends_on :macos => '>= :leopard' + depends_on :arch => :x86_64 app 'eclipse/Eclipse.app' end
Add depends_on & name stanzas to EclipseJEE Kepler
diff --git a/fcc_reboot.gemspec b/fcc_reboot.gemspec index abc1234..def5678 100644 --- a/fcc_reboot.gemspec +++ b/fcc_reboot.gemspec @@ -3,7 +3,7 @@ Gem::Specification.new do |gem| gem.add_dependency 'faraday', '~> 0.7' - gem.add_dependency 'faraday_middleware', '~> 0.7' + gem.add_dependency 'faraday_middleware', '~> 0.8' gem.add_dependency 'hashie', '~> 1.2' gem.add_dependency 'multi_json', '~> 1.3' gem.add_development_dependency 'rake'
Update faraday_middleware dependnacy to 0.8
diff --git a/test/test_wepay_rails_initialize.rb b/test/test_wepay_rails_initialize.rb index abc1234..def5678 100644 --- a/test/test_wepay_rails_initialize.rb +++ b/test/test_wepay_rails_initialize.rb @@ -1,6 +1,6 @@ require File.expand_path(File.dirname(__FILE__) + '/helper') -class TestWepayRails < ActiveSupport::TestCase +class TestWepayRailsInitialize < ActiveSupport::TestCase def teardown delete_wepay_config_file end @@ -8,24 +8,24 @@ test "should initialize WepayRails with settings from wepay.yml" do create_wepay_config_file initialize_wepay_config - gateway = WepayRails::Payments::Gateway.new + @gateway = WepayRails::Payments::Gateway.new - assert_not_nil gateway.configuration - assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] + assert_not_nil @gateway.configuration + assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] end test "should initialize WepayRails with embedded Ruby in wepay.yml.erb" do create_wepay_config_file(true) initialize_wepay_config - gateway = WepayRails::Payments::Gateway.new + @gateway = WepayRails::Payments::Gateway.new - assert_not_nil gateway.configuration - assert_equal "http://www.example.com", gateway.configuration[:root_callback_uri] - assert_equal 'abc' * 3, gateway.access_token + assert_not_nil @gateway.configuration + assert_equal "http://www.example.com", @gateway.configuration[:root_callback_uri] + assert_equal 'abc' * 3, @gateway.access_token end test "should initialize WepayRails with an existing access_token" do - gateway = WepayRails::Payments::Gateway.new("myAccessToken") - assert_equal "myAccessToken", gateway.access_token + @gateway = WepayRails::Payments::Gateway.new("myAccessToken") + assert_equal "myAccessToken", @gateway.access_token end end
Change name of test class and change local variables into object variables for clarity.
diff --git a/spec/controllers/dashboard_spec.rb b/spec/controllers/dashboard_spec.rb index abc1234..def5678 100644 --- a/spec/controllers/dashboard_spec.rb +++ b/spec/controllers/dashboard_spec.rb @@ -3,7 +3,7 @@ describe DashboardController do include Devise::Test::ControllerHelpers - render_views + # render_views Delaying this part until webpack-rails workflow is found -RC describe 'ACME endpoint' do it "has a fallback" do @@ -14,7 +14,8 @@ it "renders the terms of service" do get :tos_update expect(response.status).to eq(200) - expect(response.body).to include("webpack/tos_update.js") + # Delaying this part until webpack-rails workflow is found -RC + # expect(response.body).to include("webpack/tos_update.js") end end end
Comment out part of test that breaks in test ENV (for now)
diff --git a/test/unit/vagrant/util/numeric_test.rb b/test/unit/vagrant/util/numeric_test.rb index abc1234..def5678 100644 --- a/test/unit/vagrant/util/numeric_test.rb +++ b/test/unit/vagrant/util/numeric_test.rb @@ -0,0 +1,21 @@+require File.expand_path("../../../base", __FILE__) + +require "vagrant/util/numeric" + +describe Vagrant::Util::Numeric do + include_context "unit" + before(:each) { described_class.reset! } + subject { described_class } + + describe "#string_to_bytes" do + it "converts a string to the proper bytes" do + bytes = subject.string_to_bytes("10KB") + expect(bytes).to eq(10240) + end + + it "returns nil if the given string is the wrong format" do + bytes = subject.string_to_bytes("10 Kilobytes") + expect(bytes).to eq(nil) + end + end +end
Include unit test for numeric class
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -6,7 +6,7 @@ json = request.body.read begin ProjectImporter.import json - render :text => "ok" + render :text => "ok\n" rescue StandardError => err render :text => "Error: #{err}\n", :status => 500 end
Add newline, so shell doesn't get confused when calling via curl.
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,11 @@ module ApplicationHelper + + def start_day_time(timeslot) + Time.zone.at(timeslot.start).strftime("%A at %I:%M %p") + end + + def start_long_ordinal(timeslot) + Time.zone.at(timeslot.start).to_date.to_formatted_s(:long_ordinal) + end + end
Refactor Timeslot date format methods to helper
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,6 +11,6 @@ def content_for_title(title) provide(:title, title) - content_for(:screen_title) { content_tag(:h1) { title } } + content_for(:screen_title) { content_tag(:h1, class: 'center') { title } } end end
Add center tag so titles are centered
diff --git a/app/mailers/new_request_mailer.rb b/app/mailers/new_request_mailer.rb index abc1234..def5678 100644 --- a/app/mailers/new_request_mailer.rb +++ b/app/mailers/new_request_mailer.rb @@ -2,7 +2,9 @@ def notify(request, user) subject = "#{request.requester.first_name} needs a neighbor!" merge_vars = { - "" + "REQUEST_URL" => "/requests/#{request.id}", + "REQUEST_CONTENT" => request.content, + "FIRST_NAME" => user.first_name } body = mandrill_template('new_request', merge_vars)
Include vars to be sent over to mail template
diff --git a/spec/server/models/address_spec.rb b/spec/server/models/address_spec.rb index abc1234..def5678 100644 --- a/spec/server/models/address_spec.rb +++ b/spec/server/models/address_spec.rb @@ -2,9 +2,10 @@ class AddressSpec < Skr::TestCase - it "can be instantiated" do - model = Address.new - model.must_be_instance_of(Address) + + it "can be converted to plain string" do + address = skr_address(:hg_billing).to_s(include: [:email,:phone]) + assert_equal(address, "Hansel and Gretel\n499 Julianne Radial\nSouth Timmyville WI, 38200\nschuyler@krajcik.name 379-772-4947 x945") end end
Test to_s method on address
diff --git a/spec/tic_tac_toe/core/game_spec.rb b/spec/tic_tac_toe/core/game_spec.rb index abc1234..def5678 100644 --- a/spec/tic_tac_toe/core/game_spec.rb +++ b/spec/tic_tac_toe/core/game_spec.rb @@ -14,7 +14,8 @@ end def test_game - TicTacToe::Core::Game.new_game(board).tap do |game| + TicTacToe::Core::Game.new(board).tap do |game| + game.reset game.set_players(player, player) end end
Make the game test use new instead of new_game This way the new_game constructor can not take an injected board. Currently it's sort of confusing that new game takes a board since it also calls reset. If only new takes an injected board though, then this confustion will go away because new_game won't allow you to set a board so it doesn't matter that it calls reset, and new doesn't call reset.
diff --git a/ReactiveReSwift.podspec b/ReactiveReSwift.podspec index abc1234..def5678 100644 --- a/ReactiveReSwift.podspec +++ b/ReactiveReSwift.podspec @@ -10,7 +10,7 @@ "Charlotte Tortorella" => "charlotte@monadic.consulting" } s.source = { - :git => "https://github.com/ReSwift/ReactiveReSwift", + :git => "https://github.com/ReSwift/ReactiveReSwift.git", :tag => s.version.to_s }
Fix issue in podspec github url. Fixed lint warning "WARN | github_sources: Github repositories should end in `.git`.", added `.git`.
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index abc1234..def5678 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -1,5 +1,5 @@ class RootController < ApplicationController def index - redirect_to Journey::SiteOptions.site_root(logged_in?), 307 + redirect_to Journey::SiteOptions.site_root(logged_in?), :status => 307 end end
Use temporary redirect in root/index, since destination may change soon
diff --git a/app/presenters/manual_presenter.rb b/app/presenters/manual_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/manual_presenter.rb +++ b/app/presenters/manual_presenter.rb @@ -3,27 +3,12 @@ @manual = manual end - def title - manual.title - end - - def summary - manual.summary - end + delegate :title, to: :@manual + delegate :summary, to: :@manual + delegate :valid?, to: :@manual + delegate :errors, to: :@manual def body - GovspeakHtmlConverter.new.call(manual.body) + GovspeakHtmlConverter.new.call(@manual.body) end - - def valid? - manual.valid? - end - - def errors - manual.errors - end - -private - - attr_reader :manual end
Use `delegate` instead of explicit delegation This commit makes ManualPresenter consistent with SectionPresenter by using the same delegation style introduced in 20cd0833.
diff --git a/app/serializers/item_serializer.rb b/app/serializers/item_serializer.rb index abc1234..def5678 100644 --- a/app/serializers/item_serializer.rb +++ b/app/serializers/item_serializer.rb @@ -1,5 +1,5 @@ class ItemSerializer < ActiveModel::Serializer - attributes :id, :title, :ward, :number + attributes :id, :title, :ward, :number, :recommendations, :sections has_one :item_type end
Add Recommendations & Sections To Item Serializer
diff --git a/app/controllers/day_controller.rb b/app/controllers/day_controller.rb index abc1234..def5678 100644 --- a/app/controllers/day_controller.rb +++ b/app/controllers/day_controller.rb @@ -2,6 +2,8 @@ get '/:date?', authentication: true do |date_string| @date_string = date_string || Date.today.to_s date = Date.parse(@date_string) + + @todo_list = TodoList.find_by_date(date, user_id) @lists = List.find_by_date(date, user_id) slim :'day/index' @@ -9,25 +11,23 @@ post '/:date/list', authentication: true do |date| List.create_empty(params[:title], date, user_id) - redirect to "/#{date}" end delete '/:date/list/:id', authentication: true do |date, id| List.delete_by_id(id, user_id) - redirect to "/#{date}" end post '/:date/list/:id', authentication: true do |date, id| list = List.find_by_id(id, user_id) list.add(params[:text]) if list - - redirect to "/#{date}" end delete '/:date/list/:id/:item_id', authentication: true do |date, list_id, item_id| list = List.find_by_id(list_id, user_id) list.remove(item_id) if list + end + after '/:date/*' do |date, *| redirect to "/#{date}" end end
Refactor routes by adding after filter
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index abc1234..def5678 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -4,13 +4,13 @@ content_tag(:i, '', :class => "icon-#{icon} #{size > 1 ? "icon-#{size}x" : nil} #{classes}".strip) end - def inline_user_display(user) + def inline_user_display(user) link_to user, :class => 'inline-user-display' do - image_tag(user.gravatar_url(:size => 16)) + user.username + image_tag(user.gravatar_url(:size => 16)) + user.username end end - def badge(number) - content_tag :span, number.to_s, :class => 'badge badge-info' + def badge(number, extra_classes = "badge-info") + content_tag :span, number.to_s, :class => "badge #{extra_classes}" end end
Update badge helper to customize CSS class
diff --git a/app/models/gobierto_plans/node.rb b/app/models/gobierto_plans/node.rb index abc1234..def5678 100644 --- a/app/models/gobierto_plans/node.rb +++ b/app/models/gobierto_plans/node.rb @@ -4,6 +4,8 @@ module GobiertoPlans class Node < ApplicationRecord + include GobiertoCommon::Moderable + has_and_belongs_to_many :categories, class_name: "GobiertoCommon::Term", association_foreign_key: :category_id, join_table: :gplan_categories_nodes has_paper_trail ignore: [:visibility_level] @@ -13,6 +15,18 @@ scope :with_progress, ->(progress) { where("progress > ? AND progress <= ?", *progress.split("-")) } scope :with_interval, ->(interval) { where("starts_at >= ? AND ends_at <= ?", *interval.split(",").map { |date| Date.parse(date) }) } + extra_moderation_permissions_lookup_attributes do |_| + [{ + namespace: "site_module", + resource_name: "gobierto_plans", + resource_id: nil + }] + end + + default_moderation_stage do |node| + node.published? ? :approved : :not_sent + end + translates :name, :status enum visibility_level: { draft: 0, published: 1 }
Add moderable concern to GobiertoPlans::Node
diff --git a/app/models/survey_response_map.rb b/app/models/survey_response_map.rb index abc1234..def5678 100644 --- a/app/models/survey_response_map.rb +++ b/app/models/survey_response_map.rb @@ -2,6 +2,7 @@ # The reviewed_object id is either assignment or course id; # The reviewer_id is either assignment participant id or course participant id; # The reviewee_id is survey_deployment id. +# (if global survey is required, the reviewee_id will also be survey_deployment id) class SurveyResponseMap < ResponseMap def survey? true
Add a comment to explain how global survey works.
diff --git a/lib/lokalebasen_settings_client/settings_cache.rb b/lib/lokalebasen_settings_client/settings_cache.rb index abc1234..def5678 100644 --- a/lib/lokalebasen_settings_client/settings_cache.rb +++ b/lib/lokalebasen_settings_client/settings_cache.rb @@ -27,6 +27,8 @@ @cache[:value] end + private + def cache_valid? !@cache.nil? && !@cache[:expires].nil? &&
Make cache validity check private
diff --git a/lib/mongoid/collections/operations.rb b/lib/mongoid/collections/operations.rb index abc1234..def5678 100644 --- a/lib/mongoid/collections/operations.rb +++ b/lib/mongoid/collections/operations.rb @@ -15,6 +15,7 @@ :index_information, :map_reduce, :mapreduce, + :stats, :options ]
Return stats on the collection
diff --git a/lib/tasks/fix_missing_wiki_repos.rake b/lib/tasks/fix_missing_wiki_repos.rake index abc1234..def5678 100644 --- a/lib/tasks/fix_missing_wiki_repos.rake +++ b/lib/tasks/fix_missing_wiki_repos.rake @@ -0,0 +1,14 @@+desc "Creates missing wiki repositories" +task :fix_missing_wiki_repos => :environment do + repo_project_ids = Repository.where(:kind => Repository::KIND_WIKI).pluck(:project_id) + project_ids = Project.pluck(:id) + projects_with_missing_wiki = project_ids - repo_project_ids + + puts "Attempting to fix #{projects_with_missing_wiki.count} projects without wiki repo" + + Project.where(:id => projects_with_missing_wiki).each do |project| + command = CreateWikiRepositoryCommand.new(Gitorious::App) + repository = command.build(project) + command.execute(repository) + end +end
Add task to fix missing wiki repos
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -19,6 +19,10 @@ require "support/replica_set_simulator" require "support/stats" +# Log to a StringIO instance to make sure no exceptions are rasied by our +# logging code. +Moped.logger = Logger.new(StringIO.new, Logger::DEBUG) + RSpec.configure do |config| Support::Stats.install!
Enable (silent) logging in test suite.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,6 +22,7 @@ # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} +Dir["#{File.join(Gem.loaded_specs['kaminari'].gem_dir, 'spec')}/support/**/*.rb"].each {|f| require f} RSpec.configure do |config| config.mock_with :rr
Load Kaminari gem's spec/support files
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,7 @@ require 'simplecov' +if ENV.fetch('CIRCLE_ARTIFACTS', nil) + SimpleCov.coverage_dir File.join(ENV['CIRCLE_ARTIFACTS'], 'coverage') +end SimpleCov.start if ENV.fetch('CODECLIMATE_REPO_TOKEN', nil) require 'pry'
:nail_care: Set coverage directory for CircleCI
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -11,6 +11,6 @@ I18n.load_path = Dir['spec/i18n/*.yml'] RSpec.configure do |config| - config.filter_run_including focus: true + config.filter_run :focus config.run_all_when_everything_filtered = true end
Update RSpec's 'filter_run' config syntax
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,6 +24,7 @@ SimpleCov.start do add_filter "/lib/textris.rb" add_filter "/spec/" + add_filter "vendor" end end
Add vendor filter for proper CI coverage
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,4 @@ require_relative '../lib/story_branch' -require 'pry' RSpec.configure do |config| # some (optional) config here
Remove require on undeclared dependency, pry.
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,6 +4,9 @@ require 'vcr' require "factory_girl_rails" require 'blacklight' +require 'dotenv' +Dotenv.load + FactoryGirl.find_definitions ENV['RAILS_ENV'] ||= 'test'
Update rspec helper to load dotenv variables (thanks, Alan)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index abc1234..def5678 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,10 +1,9 @@ require 'bundler' Bundler.setup(:default, :test) +require 'howrah_renderer' require 'rspec' require 'rspec/autorun' -require 'howrah_renderer' - # gems require 'prawn_commander' require 'kmandrup-colorist'
Revert "initial commit - very few specs" This reverts commit 36d046967608439307f862cdfc3d525d17903e6b.
diff --git a/lib/kakasi/platform.rb b/lib/kakasi/platform.rb index abc1234..def5678 100644 --- a/lib/kakasi/platform.rb +++ b/lib/kakasi/platform.rb @@ -27,7 +27,7 @@ DEFLIBPATH = begin - [RbConfig::CONFIG['libir']] | + [RbConfig::CONFIG['libdir']] | case RbConfig::CONFIG['host_os'] when /mingw|mswin/i [] @@ -43,13 +43,13 @@ def self.try_load(libpath = LIBPATH) basename = map_library_name('kakasi') (libpath | DEFLIBPATH).each { |dir| + filename = File.join(dir, basename) begin - filename = File.join(dir, basename) yield filename - return filename rescue LoadError, StandardError next end + return filename } yield basename
Fix a typo and narrow the begin block that hid the typo.
diff --git a/config/application.rb b/config/application.rb index abc1234..def5678 100644 --- a/config/application.rb +++ b/config/application.rb @@ -18,7 +18,7 @@ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - config.i18n.default_locale = :fr + config.i18n.default_locale = :en config.before_configuration do env_file = File.join(Rails.root, 'config', 'local_env.yml')
Change default locale to english
diff --git a/lib/mellon/keychain.rb b/lib/mellon/keychain.rb index abc1234..def5678 100644 --- a/lib/mellon/keychain.rb +++ b/lib/mellon/keychain.rb @@ -30,13 +30,12 @@ def initialize(path) @path = path + @name = File.basename(path, ".keychain") end attr_reader :path + attr_reader :name - def name - File.basename(path, ".keychain") - end end end
Make name a precomputed attribute for nicer inspects
diff --git a/lib/plugins/soundk.rb b/lib/plugins/soundk.rb index abc1234..def5678 100644 --- a/lib/plugins/soundk.rb +++ b/lib/plugins/soundk.rb @@ -10,14 +10,14 @@ match /(help soundk)$/, method: :help def execute(m) - page = Nokogiri::HTML(open('http://www.arirang.co.kr/Radio/Radio_MessageBoard.asp?PROG_CODE=RADR0147&MENU_CODE=101865&code=Be6')) + page = Nokogiri::HTML(open('http://www.arirang.com/Radio/Radio_Announce.asp?PROG_CODE=RADR0147&MENU_CODE=101562&code=Be4')) lineup = [] - i = 0 - while i < page.css('tr.ntce td.subjt').size - lineup << page.css('tr.ntce td.subjt')[i].text unless page.css('tr.ntce td.subjt')[i].text[0].to_i == 0 - i += 1 + page.css('table.annlistTbl').first.css('td').each do |td| + next if td.text[0].to_i == 0 + lineup << td.text if td.text.include? '/' end - m.reply "[#{lineup.join('], [')}] 20:00 ~ 22:00KST" + air_time = page.css('div.airtime p').first.text + 'KST' + m.reply "[#{lineup.join('], [')}] #{air_time}" end def help(m)
Update SoundK plugin (new source url)
diff --git a/lib/puffery/client.rb b/lib/puffery/client.rb index abc1234..def5678 100644 --- a/lib/puffery/client.rb +++ b/lib/puffery/client.rb @@ -5,9 +5,9 @@ attr_accessor :url, :key - def initialize(url, key) - self.url = url - self.key = key + def initialize(url = nil, key = nil) + self.url = url || Puffery.configuration.api_url || raise('Missing Api URL') + self.key = key || Puffery.configuration.api_key || raise('Missing Api key') end def auth_header
Raise error if config vars are missing
diff --git a/lib/tunit/runnable.rb b/lib/tunit/runnable.rb index abc1234..def5678 100644 --- a/lib/tunit/runnable.rb +++ b/lib/tunit/runnable.rb @@ -17,13 +17,13 @@ super end - class << self - attr_accessor :order - end - # Randomize tests by default def self.order @order ||= :random + end + + def self.order= new_order + @order = new_order end def self.order!
Remove accessor to quell ruby warnings
diff --git a/test/govuk_component/component_smoke_test.rb b/test/govuk_component/component_smoke_test.rb index abc1234..def5678 100644 --- a/test/govuk_component/component_smoke_test.rb +++ b/test/govuk_component/component_smoke_test.rb @@ -0,0 +1,16 @@+require 'test_helper' + +class ComponentsTest < ActionView::TestCase + test "each component fixture can be rendered without errors being raised" do + doc_files = Rails.root.join('app', 'views', 'govuk_component', 'docs', '*.yml') + components = Dir[doc_files].sort.map do |file| + { id: File.basename(file, '.yml') }.merge(YAML::load_file(file)).deep_symbolize_keys + end + + components.each do |component| + component[:fixtures].each do |_, fixture| + render file: "govuk_component/#{component[:id]}.raw", locals: fixture + end + end + end +end
Add component smoke testing, using fixtures https://en.wikipedia.org/wiki/Smoke_testing_(software) Each component has a set of fixture data that is used to generate examples within govuk-component-guide, and show example usage. Use this example data to run smoke test on each component, which should give us increased confidence in catching big regressions in component view logic - or broken fixture data. It only asserts that components render without exception, not that the internal logic is correct (this should be covered by view tests).
diff --git a/lib/sufeed/checksum.rb b/lib/sufeed/checksum.rb index abc1234..def5678 100644 --- a/lib/sufeed/checksum.rb +++ b/lib/sufeed/checksum.rb @@ -5,10 +5,9 @@ module Sufeed def self.checksum(url) file = Tempfile.new('sufeed') - redirected = location(url) - puts "Redirected to #{redirected}" if url != redirected - Curl::Easy.download(redirected, file.path) - + Curl::Easy.download(url, file.path) do |curl| + curl.follow_location = true + end sha256 = Digest::SHA2.file(file.path).hexdigest return sha256 end
Fix a bug that doesn't follow a redirect chain
diff --git a/docs/user_role_scripts/change_wikipedia_expert.rb b/docs/user_role_scripts/change_wikipedia_expert.rb index abc1234..def5678 100644 --- a/docs/user_role_scripts/change_wikipedia_expert.rb +++ b/docs/user_role_scripts/change_wikipedia_expert.rb @@ -11,3 +11,10 @@ ce.user_id = new_id ce.save end + +# Add one Wikipedia Expert to all courses in a campaign +expert = User.find_by(username: 'Ian (Wiki Ed)') +Campaign.find_by_slug('fall_2020').courses.each do |course| + next if course.staff.include? expert + JoinCourse.new(course: course, user: expert, role: 4, real_name: expert.real_name) +end
Add script to add a Wikipedia expert to all courses for a campaign
diff --git a/roles/tilecache.rb b/roles/tilecache.rb index abc1234..def5678 100644 --- a/roles/tilecache.rb +++ b/roles/tilecache.rb @@ -25,7 +25,7 @@ :network_conntrack_max => { :comment => "Increase max number of connections tracked", :parameters => { - "net.netfilter.nf_conntrack_max" => "131072" + "net.netfilter.nf_conntrack_max" => "262142" } }, :kernel_tfo_listen_enable => {
Increase nf_conntrack_max for tile caches
diff --git a/spec/dummy/db/seeds.rb b/spec/dummy/db/seeds.rb index abc1234..def5678 100644 --- a/spec/dummy/db/seeds.rb +++ b/spec/dummy/db/seeds.rb @@ -20,8 +20,8 @@ end partner_user.partner.withdrawals.take(2).each { |withdrawal| withdrawal.update(created_at: 34.days.ago) } # differentiate some statuses - partner_user.partner.withdrawals.first.cancelled! - partner_user.partner.withdrawals.last.paid! + ::Referrals::UpdateWithdrawalService.new(withdrawal: partner_user.partner.withdrawals.first, status: 'cancelled').call + ::Referrals::UpdateWithdrawalService.new(withdrawal: partner_user.partner.withdrawals.last, status: 'paid').call end
Update seed to use new service
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index abc1234..def5678 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -24,6 +24,6 @@ protected def deny_access(msg) logger.warn "[#{Time.now.rfc2822}] UNAUTHORIZED ACCESS by #{current_user.login} from #{request.remote_ip}: #{msg}" - redirect_to :controller => 'index', :action => 'error', :type => 'access' + redirect_to :controller => '/index', :action => 'error', :type => 'access' end end
Improve redirection for access denied messages
diff --git a/app/presenters/govspeak_body_presenter.rb b/app/presenters/govspeak_body_presenter.rb index abc1234..def5678 100644 --- a/app/presenters/govspeak_body_presenter.rb +++ b/app/presenters/govspeak_body_presenter.rb @@ -35,8 +35,12 @@ end def matching_attachment(filename) - document.attachments.detect do |att| - sanitise_filename(att.url) == sanitise_filename(filename) + attachments_by_sanitised_filename[sanitise_filename(filename)] + end + + def attachments_by_sanitised_filename + @attachments_by_sanitised_filename ||= document.attachments.each_with_object({}) do |attachment, memo| + memo[sanitise_filename(attachment.url)] = attachment end end
Improve Govspeak presenting with cached sanitising This changes how we lookup atttachments from a big loop to instead a cached hash. This improves performance on documents with large numbers of attachments.
diff --git a/lib/cryptoexchange/exchanges/aex/services/pairs.rb b/lib/cryptoexchange/exchanges/aex/services/pairs.rb index abc1234..def5678 100644 --- a/lib/cryptoexchange/exchanges/aex/services/pairs.rb +++ b/lib/cryptoexchange/exchanges/aex/services/pairs.rb @@ -4,8 +4,7 @@ class Pairs < Cryptoexchange::Services::Pairs PAIRS_URLS = [ "#{Cryptoexchange::Exchanges::Aex::Market::API_URL}/ticker.php?c=all&mk_type=btc", - "#{Cryptoexchange::Exchanges::Aex::Market::API_URL}/ticker.php?c=all&mk_type=bitcny", - "#{Cryptoexchange::Exchanges::Aex::Market::API_URL}/ticker.php?c=all&mk_type=bitusd" + "#{Cryptoexchange::Exchanges::Aex::Market::API_URL}/ticker.php?c=all&mk_type=bitcny" ] def fetch
Remove deprecated base coin from aex
diff --git a/lib/dry/system/provider_sources/settings/loader.rb b/lib/dry/system/provider_sources/settings/loader.rb index abc1234..def5678 100644 --- a/lib/dry/system/provider_sources/settings/loader.rb +++ b/lib/dry/system/provider_sources/settings/loader.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "dry/configurable" +require "dry/core/deprecations" module Dry module System @@ -28,6 +29,12 @@ require "dotenv" Dotenv.load(*dotenv_files(root, env)) if defined?(Dotenv) rescue LoadError + Dry::Core::Deprecations.announce( + "Dry::System :settings provider now requires dotenv to to load settings from .env files`", # rubocop:disable Layout/LineLength + "Add `gem \"dotenv\"` to your application's `Gemfile`", + tag: "dry-system", + uplevel: 3 + ) # Do nothing if dotenv is unavailable end
Add deprecation notice if dotenv is unavailable
diff --git a/simple_aws.gemspec b/simple_aws.gemspec index abc1234..def5678 100644 --- a/simple_aws.gemspec +++ b/simple_aws.gemspec @@ -10,8 +10,8 @@ s.summary = "The simplest and easiest to use and maintain AWS communication library" s.description = "The simplest and easiest to use and maintain AWS communication library" - s.add_dependency "ox" - s.add_dependency "httparty" + s.add_dependency "nokogiri", "~> 1.5.0" + s.add_dependency "httparty", "~> 0.8.0" s.add_dependency "jruby-openssl" if RUBY_PLATFORM == 'java'
Swap out Ox for Nokogiri, specify versions
diff --git a/db/migrate/20150731225331_migrate_old_moved_posts.rb b/db/migrate/20150731225331_migrate_old_moved_posts.rb index abc1234..def5678 100644 --- a/db/migrate/20150731225331_migrate_old_moved_posts.rb +++ b/db/migrate/20150731225331_migrate_old_moved_posts.rb @@ -0,0 +1,6 @@+class MigrateOldMovedPosts < ActiveRecord::Migration + def up + execute "UPDATE posts SET post_type = 3, action_code = 'split_topic' WHERE post_type = 2 AND raw ~* '^I moved [a\\d]+ posts? to a new topic:'" + execute "UPDATE posts SET post_type = 3, action_code = 'split_topic' WHERE post_type = 2 AND raw ~* '^I moved [a\\d]+ posts? to an existing topic:'" + end +end
Migrate old moved posts messages in English
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -12,5 +12,5 @@ end chef_version '>= 12.0' if respond_to?(:chef_version) supports 'debian' -version '1.47.0' -y + +version '1.49.0'
Revert "Seems to be redundant, anyway" This reverts commit 6410eb26a838b3abced105c1a8692ffae08026d7.
diff --git a/lib/activeadmin_addons/support/input_base.rb b/lib/activeadmin_addons/support/input_base.rb index abc1234..def5678 100644 --- a/lib/activeadmin_addons/support/input_base.rb +++ b/lib/activeadmin_addons/support/input_base.rb @@ -16,7 +16,10 @@ end def input_html_options - super.merge(control_attributes) + # maxwidth and size are added by Formtastic::Inputs::StringInput + # but according to the HTML standard these are not valid attributes + # on the inputs provided by this module + super.except(:maxlength, :size).merge(control_attributes) end def parts_to_html
Remove invalid html attributes for inputs
diff --git a/lib/aasm_with_fixes.rb b/lib/aasm_with_fixes.rb index abc1234..def5678 100644 --- a/lib/aasm_with_fixes.rb +++ b/lib/aasm_with_fixes.rb @@ -1,14 +1,16 @@+module AASM + class StateMachine + def clone + klone = super + klone.states = states.clone + klone.events = events.clone + klone + end + end +end + module AASMWithFixes def self.included(base) base.send(:include, AASM) - base.module_eval do - class << self - def inherited(child) - AASM::StateMachine[child] = AASM::StateMachine[self].clone - AASM::StateMachine[child].events = AASM::StateMachine[self].events.clone - super - end - end - end end -end+end
Update monkey patch to work with AASM 2.0.5
diff --git a/carrierwave-aws.gemspec b/carrierwave-aws.gemspec index abc1234..def5678 100644 --- a/carrierwave-aws.gemspec +++ b/carrierwave-aws.gemspec @@ -17,7 +17,7 @@ gem.require_paths = ['lib'] gem.add_dependency 'carrierwave', '>= 0.7', '< 2.0' - gem.add_dependency 'aws-sdk', '~> 2.0' + gem.add_dependency 'aws-sdk', '~> 2.1' gem.add_development_dependency 'rake', '~> 10.0' gem.add_development_dependency 'rspec', '~> 3.0'
Update aws-sdk to ~> 2.1 Aws.eager_autoload! was introduced in 2.1.0 (#113)
diff --git a/spec/chef/recipes/sidekiq_spec.rb b/spec/chef/recipes/sidekiq_spec.rb index abc1234..def5678 100644 --- a/spec/chef/recipes/sidekiq_spec.rb +++ b/spec/chef/recipes/sidekiq_spec.rb @@ -10,6 +10,18 @@ context 'with default values' do it 'correctly renders out the sidekiq service file' do expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run").with_content(/\-C \/opt\/gitlab\/embedded\/service\/.*\/config\/sidekiq_queues.yml/) + expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run").with_content(/\-t 4/) + expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run").with_content(/\-c 25/) + end + end + + context 'with specified values' do + before do + stub_gitlab_rb(sidekiq: { shutdown_timeout: 8, concurrency: 35}) + end + it 'correctly renders out the sidekiq service file' do + expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run").with_content(/\-t 8/) + expect(chef_run).to render_file("/opt/gitlab/sv/sidekiq/run").with_content(/\-c 35/) end end end
Add sidekiq specs - User specified values
diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb index abc1234..def5678 100644 --- a/spec/unit/recipes/default_spec.rb +++ b/spec/unit/recipes/default_spec.rb @@ -2,7 +2,7 @@ # Cookbook:: winrm # Spec:: default # -# Copyright:: 2017, The Authors, All Rights Reserved. +# Copyright:: 2017, Peter Crossley require 'spec_helper'
Fix the copyright in the spec Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
diff --git a/lib/pay.rb b/lib/pay.rb index abc1234..def5678 100644 --- a/lib/pay.rb +++ b/lib/pay.rb @@ -9,10 +9,14 @@ require_relative 'pay/subscription/braintree' # Webhook processors +require_relative 'pay/stripe/charge_refunded' require_relative 'pay/stripe/charge_succeeded' -require_relative 'pay/stripe/charge_refunded' -require_relative 'pay/stripe/subscription_canceled' +require_relative 'pay/stripe/customer_deleted' +require_relative 'pay/stripe/customer_updated' +require_relative 'pay/stripe/source_deleted' +require_relative 'pay/stripe/subscription_deleted' require_relative 'pay/stripe/subscription_renewing' +require_relative 'pay/stripe/subscription_updated' module Pay # Define who owns the subscription
Load all stripe event webhooks
diff --git a/spec/factories/locations.rb b/spec/factories/locations.rb index abc1234..def5678 100644 --- a/spec/factories/locations.rb +++ b/spec/factories/locations.rb @@ -1,7 +1,7 @@ FactoryGirl.define do factory :location, aliases: [:location_country] do - iso_code3 { (0...3).map { (65 + rand(26)).chr }.join } - iso_code2 { (0...2).map { (65 + rand(26)).chr }.join } + sequence :iso_code2 { |n| ('AA'..'ZZ').to_a[n] } + sequence :iso_code3 { |n| ('AAA'..'ZZZ').to_a[n] } pik_name 'MyText' cait_name 'MyText' ndcp_navigators_name 'MyText'
Replace factory rand with sequences
diff --git a/spec/features/users_spec.rb b/spec/features/users_spec.rb index abc1234..def5678 100644 --- a/spec/features/users_spec.rb +++ b/spec/features/users_spec.rb @@ -0,0 +1,18 @@+require 'rails_helper' + +feature 'User Management' do + + scenario 'register a new user' do + visit root_path + expect { + click_link 'Register' + fill_in 'Username', with: "brian" + fill_in 'Password', with: "a" + fill_in 'Password confirmation', with: "a" + click_button 'Save User' + }.to change(User, :count).by(1) + + expect(current_path).to eq user_path(User.last) + end + +end
Add regiester user feature test.
diff --git a/spec/reserved_words_spec.rb b/spec/reserved_words_spec.rb index abc1234..def5678 100644 --- a/spec/reserved_words_spec.rb +++ b/spec/reserved_words_spec.rb @@ -8,6 +8,12 @@ describe '.list' do it 'returns initial reserved words' do expect(ReservedWords.list).to eq default_words + end + + it 'should not return duplicate reserved words' do + initial_count = ReservedWords.list.count + ReservedWords.add(ReservedWords.list.first) + expect(ReservedWords.list.count).to eq initial_count end end
Add spec to check duplicated reserved words
diff --git a/release/spec/postgres_upgrade.sh_spec.rb b/release/spec/postgres_upgrade.sh_spec.rb index abc1234..def5678 100644 --- a/release/spec/postgres_upgrade.sh_spec.rb +++ b/release/spec/postgres_upgrade.sh_spec.rb @@ -9,8 +9,7 @@ FileUtils.touch 'tmp/store/postgres/postgresql.conf' FileUtils.mkdir_p 'tmp/jobs/postgres-9.4.5/bin' FileUtils.touch 'tmp/jobs/postgres-9.4.5/bin/postgres_db_upgrade.sh' - expect(File.exist?('tmp/jobs/postgres-9.4.5/bin/postgres_db_upgrade.sh')).to eq(true) - expect(File.chmod(777, 'tmp/jobs/postgres-9.4.5/bin/postgres_db_upgrade.sh')).to eq(1) + File.chmod(755, 'tmp/jobs/postgres-9.4.5/bin/postgres_db_upgrade.sh') ENV['BASE_DIR'] = 'tmp' end
Set less permissive permissions to fix the build on Travis [#114012649](https://www.pivotaltracker.com/story/show/114012649)
diff --git a/lib/hanami/cli_base.rb b/lib/hanami/cli_base.rb index abc1234..def5678 100644 --- a/lib/hanami/cli_base.rb +++ b/lib/hanami/cli_base.rb @@ -1,8 +1,11 @@ module Hanami module CliBase - # Add new custom CLI command to special CLI class + # Add new custom CLI command to special CLI class. + # Please be careful. This is a private method that + # can be deleted soon. # # @since x.x.x + # @api private # # @example Usage with Cli class # require 'hanami'
Update documentation. Add private status for method.
diff --git a/lib/wotd.rb b/lib/wotd.rb index abc1234..def5678 100644 --- a/lib/wotd.rb +++ b/lib/wotd.rb @@ -5,7 +5,6 @@ module Wotd class Wotd DAY_IN_SECONDS = 86_4000 - MONTH_IN_SECONDS = 2_688_000 attr_accessor :subreddit @@ -14,12 +13,12 @@ end def update - top = reddit.top + top = reddit.articles('top', querystring: 'sort=top&t=day') top.each do |article| key = "reddit:#{subreddit}:#{article.id}" unless redis.exists(key) redis.set(key, article.title) - redis.expire(key, MONTH_IN_SECONDS) + redis.expire(key, DAY_IN_SECONDS) end end end @@ -32,8 +31,10 @@ def get # update first, before picking - update unless backoff? - backoff(DAY_IN_SECONDS) + unless hit? + update + backoff(DAY_IN_SECONDS) + end pick = redis.keys("reddit:#{subreddit}:*").sample redis.get(pick) @@ -44,7 +45,7 @@ redis.expire("wotd:#{subreddit}", seconds) end - def backoff? + def hit? !!redis.get("wotd:#{subreddit}") end
Set backoff timer after update
diff --git a/lib/liquid/document.rb b/lib/liquid/document.rb index abc1234..def5678 100644 --- a/lib/liquid/document.rb +++ b/lib/liquid/document.rb @@ -1,15 +1,26 @@ # frozen_string_literal: true module Liquid - class Document < BlockBody + class Document def self.parse(tokens, parse_context) - doc = new + doc = new(parse_context) doc.parse(tokens, parse_context) doc end + attr_reader :parse_context, :body + + def initialize(parse_context) + @parse_context = parse_context + @body = new_body + end + + def nodelist + @body.nodelist + end + def parse(tokens, parse_context) - super do |end_tag_name, _end_tag_params| + @body.parse(tokens, parse_context) do |end_tag_name, _end_tag_params| unknown_tag(end_tag_name, parse_context) if end_tag_name end rescue SyntaxError => e @@ -25,5 +36,19 @@ raise SyntaxError, parse_context.locale.t("errors.syntax.unknown_tag", tag: tag) end end + + def render_to_output_buffer(context, output) + @body.render_to_output_buffer(context, output) + end + + def render(context) + @body.render(context) + end + + private + + def new_body + Liquid::BlockBody.new + end end end
Use BlockBody from Document using composition rather than inheritence This way liquid-c can more cleanly use a Liquid::C::BlockBody object for the block body by overriding Liquid::Document#new_body.
diff --git a/lob.gemspec b/lob.gemspec index abc1234..def5678 100644 --- a/lob.gemspec +++ b/lob.gemspec @@ -10,7 +10,7 @@ spec.email = ["akash@akash.im", "leore@lob.com"] spec.description = %q{Lob API Ruby wrapper} spec.summary = %q{Ruby wrapper for Lob.com API with ActiveRecord-style syntax} - spec.homepage = "https://github.com/lobapi/lob-ruby" + spec.homepage = "https://github.com/lob/lob-ruby" spec.license = "MIT" spec.files = `git ls-files`.split($/)
Update repo url in gemspec
diff --git a/log.gemspec b/log.gemspec index abc1234..def5678 100644 --- a/log.gemspec +++ b/log.gemspec @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'log' - s.version = '0.4.2.1' + s.version = '0.4.2.2' s.summary = 'Logging to STD IO with levels, tagging, and coloring' s.description = ' '
Package version is increased from 0.4.2.1 to 0.4.2.2
diff --git a/lib/rafters/railtie.rb b/lib/rafters/railtie.rb index abc1234..def5678 100644 --- a/lib/rafters/railtie.rb +++ b/lib/rafters/railtie.rb @@ -18,7 +18,7 @@ app.config.autoload_paths += Dir[app.root.join("app", "components", "*/")] end - config.after_initialize do |app| + initializer "register.preprocessors" do |app| app.assets.unregister_preprocessor('text/css', Sprockets::DirectiveProcessor) app.assets.register_preprocessor('text/css', Rafters::DirectiveProcessor)
Move preprocessor registration into an initializer
diff --git a/lib/legal_markdown/legal_to_markdown/writer.rb b/lib/legal_markdown/legal_to_markdown/writer.rb index abc1234..def5678 100644 --- a/lib/legal_markdown/legal_to_markdown/writer.rb +++ b/lib/legal_markdown/legal_to_markdown/writer.rb @@ -6,7 +6,7 @@ require 'json' if writer == :jason if @output_file && @output_file != "-" File.open(@output_file, "w") {|f| f.write( final_content ); f.close } if writer == :markdown - File.open(@output_file, "w") { |f| IO.write( f, JSON.pretty_generate( final_content ) ); f.close } if writer == :jason + File.open(@output_file, "w") { |f| f.write( JSON.pretty_generate( final_content ) ); f.close } if writer == :jason else STDOUT.write final_content end
Fix write issue with 1.9.2
diff --git a/lib/modules/trade/rebuild_compliance_mviews.rb b/lib/modules/trade/rebuild_compliance_mviews.rb index abc1234..def5678 100644 --- a/lib/modules/trade/rebuild_compliance_mviews.rb +++ b/lib/modules/trade/rebuild_compliance_mviews.rb @@ -0,0 +1,44 @@+module Trade::RebuildComplianceMviews + def self.run + [ + :appendix_i, + :mandatory_quotas, + :cites_suspensions + ].each do |p| + puts "Rebuild #{p} mview..." + self.rebuild_compliance_mview(p) + end + end + + def self.rebuild_compliance_mview(type) + views = Dir["db/views/trade_shipments_#{type}_view/*"] + latest_view = views.map { |v| v.split("/").last }.sort.last.split('.').first + self.recreate_mview(type, latest_view) + end + + def self.recreate_mview(type, sql_view) + view_name = "trade_shipments_#{type}_view" + mview_name = "trade_shipments_#{type}_mview" + ActiveRecord::Base.transaction do + command = "DROP MATERIALIZED VIEW IF EXISTS #{mview_name} CASCADE" + puts command + puts db.execute(command) + + command = "DROP VIEW IF EXISTS #{view_name}" + puts command + db.execute(command) + + command = "CREATE VIEW #{view_name} AS #{ActiveRecord::Migration.view_sql(sql_view, view_name)}" + puts command + db.execute(command) + + command = "CREATE MATERIALIZED VIEW #{mview_name} AS SELECT * FROM #{view_name}" + puts command + db.execute(command) + end + end + + def self.db + ActiveRecord::Base.connection + end +end
Create module to rebuild compliance mviews
diff --git a/lib/paperclip_processors/metadata_extractor.rb b/lib/paperclip_processors/metadata_extractor.rb index abc1234..def5678 100644 --- a/lib/paperclip_processors/metadata_extractor.rb +++ b/lib/paperclip_processors/metadata_extractor.rb @@ -7,7 +7,15 @@ # add values to the attachment instance (for db persistence, etc) # assumes duration is a column in the table this attachment is being # added to. + + # a simple assignment works if you are not background processing your + # paperclip processing attachment.instance.duration = metadata.duration + + # if you are background processing your paperclip processing which is + # common when working with videos you'll want to ensure the instance gets + # saved at some point in the processor chain, use: + # attachment.instance.update_attribute(:duration, metadata.duration) # always return a reference to the file when done file
Add documentation for paperclip post processor and ensuring the attachment instance is saved when using background paperclip processing.
diff --git a/app/helpers/app_frame/pagination_helper.rb b/app/helpers/app_frame/pagination_helper.rb index abc1234..def5678 100644 --- a/app/helpers/app_frame/pagination_helper.rb +++ b/app/helpers/app_frame/pagination_helper.rb @@ -7,6 +7,6 @@ range_end = (page) * per_page range_end = count if range_end > count - "<p class='page-range'>Displaying <strong>#{range_start} - #{range_end}</strong> of <strong>#{count}</strong> in total</p>".html_safe + "<div class='page-range'>Displaying <strong>#{range_start} - #{range_end}</strong> of <strong>#{count}</strong> in total</div>".html_safe end end
Use divs instead of paragraphs for pagination results
diff --git a/app/controllers/oauth2/users_controller.rb b/app/controllers/oauth2/users_controller.rb index abc1234..def5678 100644 --- a/app/controllers/oauth2/users_controller.rb +++ b/app/controllers/oauth2/users_controller.rb @@ -20,7 +20,11 @@ end def ensure_token! - unless token = params[:access_token] || params[:oauth_token] + if header = request.headers['Authorization'] + token = header[/Bearer (.+)/, 1] + end + token ||= params[:access_token] || params[:oauth_token] + unless token raise Vidibus::Oauth2Server::MissingTokenError end @access_token = Oauth2Token.find!(:token => token)
Support bearer token in header
diff --git a/app/overrides/add_ads_to_admin_menu_tab.rb b/app/overrides/add_ads_to_admin_menu_tab.rb index abc1234..def5678 100644 --- a/app/overrides/add_ads_to_admin_menu_tab.rb +++ b/app/overrides/add_ads_to_admin_menu_tab.rb @@ -1,5 +1,5 @@ Deface::Override.new(:virtual_path => "spree/admin/shared/_menu", :name => "ads_admin_tabs", :insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]", - :text => "<%= tab(:ads, label: 'Ads', url: spree.admin_ads_path, icon: 'file') %>", + :text => "<%= tab(:ads, label: 'Ads', url: spree.admin_ads_path, icon: 'newspaper-o') %>", :disabled => false)
Change icon on the admin ad menu
diff --git a/app/services/diba_authorization_handler.rb b/app/services/diba_authorization_handler.rb index abc1234..def5678 100644 --- a/app/services/diba_authorization_handler.rb +++ b/app/services/diba_authorization_handler.rb @@ -45,6 +45,7 @@ def api_handler @api_handler ||= DibaCensusApiAuthorizationHandler.new(user: user, id_document: id_document, + document_type: document_type, birthdate: birthdate) .with_context(context) end
Fix combined AuthorizationHandler for API API AuthorizationHandler was not working when combined with the CensusData one. A parameter was not being initialized.
diff --git a/webrtc-ios.podspec b/webrtc-ios.podspec index abc1234..def5678 100644 --- a/webrtc-ios.podspec +++ b/webrtc-ios.podspec @@ -10,4 +10,10 @@ s.source_files = "include/**/*.h" s.vendored_libraries = "lib/*.a" s.requires_arc = false + s.library = 'sqlite3', 'stdc++' + s.framework = 'AVFoundation', 'AudioToolbox', 'CoreMedia' + s.xcconfig = { + 'OTHER_LDFLAGS' => '-stdlib=libstdc++', + 'ARCHS' => 'armv7' + } end
Add library/framework dependancies and and linker flags for GNU C++ standard library and forcing armv7.
diff --git a/app/tasks/import_contacts/more_info_url.rb b/app/tasks/import_contacts/more_info_url.rb index abc1234..def5678 100644 --- a/app/tasks/import_contacts/more_info_url.rb +++ b/app/tasks/import_contacts/more_info_url.rb @@ -3,7 +3,7 @@ include Virtus.value_object class MarkdownRenderer - URL_PART = %Q{[%{url}](%{url_title})} + URL_PART = %Q{[%{url_title}](%{url})} DESCRIPTION_PART = %Q{%{url_description}} delegate :url, :description, :title, to: :@more_info_url
Fix for URL formatting from MarkdownRenderer From https://www.pivotaltracker.com/story/show/66658408. URL title and URL were the wrong way round on import.
diff --git a/app/views/api/v1/taxon_concepts/index.rabl b/app/views/api/v1/taxon_concepts/index.rabl index abc1234..def5678 100644 --- a/app/views/api/v1/taxon_concepts/index.rabl +++ b/app/views/api/v1/taxon_concepts/index.rabl @@ -21,6 +21,7 @@ node(:cites_listings, if: :is_accepted_name?) { |tc| tc.current_cites_additions.map do |cl| { + :id => cl.id, :appendix => cl.species_listing_name, :annotation => cl.annotation, :hash_annotation => cl.hash_annotation,
Add CITES listing id within the cites_listings node
diff --git a/app/controllers/api/v1/projects_controller.rb b/app/controllers/api/v1/projects_controller.rb index abc1234..def5678 100644 --- a/app/controllers/api/v1/projects_controller.rb +++ b/app/controllers/api/v1/projects_controller.rb @@ -1,10 +1,10 @@ class Api::V1::ProjectsController < Api::V1::BaseController - def index @bucket = Project - @client = Client.find_by_id(params["client_id"]) - @bucket = @bucket.for_user(current_user) - @bucket = @bucket.for_client(@client) if @client + @bucket = @bucket.sort_by_name.for_client_id(params[:client_id]) + unless admin? + @bucket = @bucket.for_user_and_role(current_user, :developer) + end @projects = @bucket.order("name").all render :json => @projects end
Tweak projects api to show admins all projects, not just 'their 'projects
diff --git a/lib/slugger/history.rb b/lib/slugger/history.rb index abc1234..def5678 100644 --- a/lib/slugger/history.rb +++ b/lib/slugger/history.rb @@ -12,7 +12,7 @@ def set_slug_history if self.slugger[:slug_was] && (self.slugger[:slug_was] != self.slug || self.destroyed?) - Slugger::Slug.create(model_type: self.class.to_s, model_id: self.id, slug: self.slugger[:slug_was]) + Slugger::Slug.create(model_type: self.class.name, model_id: self.id, slug: self.slugger[:slug_was]) end end
Use class name instead of to_s.
diff --git a/Casks/radiant-player.rb b/Casks/radiant-player.rb index abc1234..def5678 100644 --- a/Casks/radiant-player.rb +++ b/Casks/radiant-player.rb @@ -1,7 +1,7 @@ class RadiantPlayer < Cask - url 'https://github.com/kbhomes/google-music-mac/releases/download/v1.1.3/Radiant.Player.zip' + url 'https://github.com/kbhomes/google-music-mac/releases/download/v1.2.0/Radiant.Player.zip' homepage 'http://kbhomes.github.io/google-music-mac/' - version '1.1.3' - sha256 'd263c856b4c8e61ddb1cc04ac7bfbbd7b88aa07b052b0bc49cd06da84ce51f6f' + version '1.2.0' + sha256 '7a9a0d7b1a17cee599012f216cc285bcabe6a1005ddb87d531e7a44875a67131' link 'Radiant Player.app' end
Upgrade Radiant Player app to v1.2
diff --git a/lib/tasks/fullapp.rake b/lib/tasks/fullapp.rake index abc1234..def5678 100644 --- a/lib/tasks/fullapp.rake +++ b/lib/tasks/fullapp.rake @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rubocop/rake_task' + namespace :lca do desc 'Run full Rspec and Jest test suites' task test: [:spec, 'lca:frontend:test'] @@ -8,17 +9,19 @@ namespace :test do desc 'Run Rspec as normal and Jest with optional coverage report' task cov: [:spec, 'lca:frontend:testcov'] + end + desc 'Lint both the frontend and backend' + task lint: ['lca:lint:rubocop', 'lca:frontend:lint'] + + namespace :lint do desc 'Lint code with rubocop' RuboCop::RakeTask.new(:rubocop) do |tsk| tsk.options = ['-DR'] tsk.fail_on_error = false end + end - desc 'Lint both the frontend and backend' - task lintall: ['lca:test:rubocop', 'lca:frontend:lint'] - - desc 'Run full test suite and lint suite' - task everything: ['lca:test', 'lca:test:lintall'] - end + desc 'Run full test suite and lint suite' + task everything: ['lca:test', 'lca:lint'] end
Rearrange rake tasks a bit
diff --git a/lib/tictactoe_board.rb b/lib/tictactoe_board.rb index abc1234..def5678 100644 --- a/lib/tictactoe_board.rb +++ b/lib/tictactoe_board.rb @@ -0,0 +1,34 @@+$: << File.dirname(__FILE__) + +class TictactoeBoard + + attr_accessor :board, :turn + attr_reader :desc, :valid_slots + + + def initialize (board = Array.new(9, " "), turn = "X") + @board = board + @turn = turn + @desc = { + name: "TacTacToe", + instructions: "You (X) and the computer (O) will take turns placing a 'X' and 'O' respectively, the player who succeeds in placing three of their marks in a horizontal, vertical or diagonal row wins."} + end + + def move(input) + played_move = TictactoeBoard.new(@board.dup, whose_turn("O", "X")) + played_move.board[input.to_i] = turn + played_move + end + + def valid_slots + @board.each_with_index.map{|symbol, index| index if symbol==" "}.reject{|slots| slots == nil } + end + + def whose_turn(x, o) + turn == "X" ? x : o + end + + +end + +
Add new file for tictactoeboard
diff --git a/lib/controllers/print.rb b/lib/controllers/print.rb index abc1234..def5678 100644 --- a/lib/controllers/print.rb +++ b/lib/controllers/print.rb @@ -6,7 +6,8 @@ save_and_generate_pdf html - send_file "#{full_path_name}.pdf", filename: "#{name}.pdf" + # send_file + send_data File.read("#{full_path_name}.pdf"), filename: "#{name}.pdf" end def save_and_generate_pdf(html)
Use send_data instead of send_file
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -1,4 +1,4 @@-name "cookbook-omnibus-openstack" +name "omnibus-openstack" maintainer "Craig Tracey <craigtracey@gmail.com>" license "Apache 2.0" description "Cookbook for supporting omnibus-openstack"
Rename the cookbook so that berks is happy Seems that with berks 3 you need parity between the cookbook name and the Berksfile. So, rename it here.
diff --git a/metadata.rb b/metadata.rb index abc1234..def5678 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,9 +3,14 @@ maintainer_email 'cookbooks@chef.io' license 'Apache 2.0' description 'Installs/Configures yum-repoforge' +long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.5.3' -source_url 'https://github.com/chef-cookbooks/yum-repoforge'if respond_to?(:source_url) +source_url 'https://github.com/chef-cookbooks/yum-repoforge' if respond_to?(:source_url) issues_url 'https://github.com/chef-cookbooks/yum-repoforge/issues' if respond_to?(:issues_url) depends 'yum', '~> 3.2' depends 'yum-epel' + +%w(amazon centos fedora oracle redhat scientific).each do |os| + supports os +end
Add OS support and long_description
diff --git a/opendns-dnsdb.gemspec b/opendns-dnsdb.gemspec index abc1234..def5678 100644 --- a/opendns-dnsdb.gemspec +++ b/opendns-dnsdb.gemspec @@ -7,6 +7,7 @@ gem.description = "Client library for the OpenDNS Security Graph" gem.summary = gem.description gem.homepage = "https://github.com/jedisct1/opendns-dnsdb-ruby" + gem.license = "MIT" gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } gem.files = `git ls-files`.split("\n")
Add license to the gemspec file
diff --git a/cookbooks/cicd_infrastructure/metadata.rb b/cookbooks/cicd_infrastructure/metadata.rb index abc1234..def5678 100644 --- a/cookbooks/cicd_infrastructure/metadata.rb +++ b/cookbooks/cicd_infrastructure/metadata.rb @@ -7,7 +7,5 @@ # long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0' -depends 'openldap' depends 'java' depends 'jira' -depends 'chef-sugar'
Remove dependences for other modules
diff --git a/cookbooks/zookeeper/attributes/default.rb b/cookbooks/zookeeper/attributes/default.rb index abc1234..def5678 100644 --- a/cookbooks/zookeeper/attributes/default.rb +++ b/cookbooks/zookeeper/attributes/default.rb @@ -1,9 +1,9 @@ default[:zookeeper][:version] = "3.3.4" -default[:zookeeper][:installDir] = "/usr/local/share/zookeeper" +default[:zookeeper][:installDir] = "/opt/zookeeper" default[:zookeeper][:logDir] = '/var/log/zookeeper' default[:zookeeper][:dataDir] = "/var/zookeeper" -default[:zookeeper][:snapshotDir] = "/var/lib/zookeeper/snapshots" +default[:zookeeper][:snapshotDir] = "#{default[:zookeeper][:dataDir]}/snapshots" default[:zookeeper][:tickTime] = 2000 default[:zookeeper][:initLimit] = 10
Move installdir to /opt/zookeeper and make snapshotdir inside of whatever datadir is
diff --git a/core/spec/acceptance/approve_user_spec.rb b/core/spec/acceptance/approve_user_spec.rb index abc1234..def5678 100644 --- a/core/spec/acceptance/approve_user_spec.rb +++ b/core/spec/acceptance/approve_user_spec.rb @@ -30,4 +30,12 @@ current_url.should_not equal old_url end + + it 'shows "account already set up" message when reset token is invalid' do + user = create :user + + visit edit_user_password_path(msg: 'hoi', reset_password_token: 'doei') + + page.should have_content 'Your account is already set up. Please log in to continue.' + end end
Check if notice appears on login page After being redirected from the initial account setup (password reset with message) a message should appear informing the user about the already set up account.
diff --git a/app/services/slack_message_services/remind_members_who_forget_ordering.rb b/app/services/slack_message_services/remind_members_who_forget_ordering.rb index abc1234..def5678 100644 --- a/app/services/slack_message_services/remind_members_who_forget_ordering.rb +++ b/app/services/slack_message_services/remind_members_who_forget_ordering.rb @@ -6,8 +6,6 @@ content = format_content send_message(content) end - - private def self.format_content username_string = members_have_not_ordered_lunch.map { |member| "@#{member}" }
Remove useless private access modifier at service
diff --git a/spec/models/establishment_spec.rb b/spec/models/establishment_spec.rb index abc1234..def5678 100644 --- a/spec/models/establishment_spec.rb +++ b/spec/models/establishment_spec.rb @@ -1,6 +1,71 @@ require 'rails_helper' - +#All Validation And Association Test Complete describe Establishment do - + let(:establishment){Establishment.create({name: "test", address_1: "test", city: "test", state: "test", zip: "12345"})} + let(:establishment_2){Establishment.new} + let(:favorite){Favorite.create()} + context "Validations" do + describe "name" do + it "is not valid if nil" do + establishment_2.valid? + expect(establishment_2.errors[:name]).to_not be_empty + end + it "is valid if not nil" do + establishment.valid? + expect(establishment.errors[:name]).to be_empty + end + end + describe "address_1" do + it "is not valid if nil" do + establishment_2.valid? + expect(establishment_2.errors[:address_1]).to_not be_empty + end + it "is valid if not nil" do + establishment.valid? + expect(establishment.errors[:address_1]).to be_empty + end + end + describe "city" do + it "is not valid if nil" do + establishment_2.valid? + expect(establishment_2.errors[:city]).to_not be_empty + end + it "is valid if not nil" do + establishment.valid? + expect(establishment.errors[:city]).to be_empty + end + end + describe "state" do + it "is not valid if nil" do + establishment_2.valid? + expect(establishment_2.errors[:state]).to_not be_empty + end + it "is valid if not nil" do + establishment.valid? + expect(establishment.errors[:state]).to be_empty + end + end + describe "zip" do + it "is not valid if nil" do + establishment_2.valid? + expect(establishment_2.errors[:zip]).to_not be_empty + end + it "is valid if not nil" do + establishment.valid? + expect(establishment.errors[:zip]).to be_empty + end + end + end + context "Associations" do + describe "favorites" do + it "returns an array of favorites if it has them" do + establishment.favorites << favorite + expect(establishment.favorites).to eq([favorite]) + end + it "returns an empty array if it has none" do + expect(establishment.favorites).to eq([]) + end + end + end end
Add Establishme Model Validation And Association Tests
diff --git a/spec/freddy/sync_response_container_spec.rb b/spec/freddy/sync_response_container_spec.rb index abc1234..def5678 100644 --- a/spec/freddy/sync_response_container_spec.rb +++ b/spec/freddy/sync_response_container_spec.rb @@ -39,6 +39,7 @@ end describe '#wait_for_response' do + let(:timeout) { 2 } let(:response) { {msg: 'response'} } let(:delivery) { OpenStruct.new(type: 'success') } @@ -48,7 +49,7 @@ end it 'returns response' do - expect(container.wait_for_response(2)).to eq(response) + expect(container.wait_for_response(timeout)).to eq(response) end end end
Use timeout variable instead of arbitrary integer
diff --git a/db/migrate/20080808192921_update_sites.rb b/db/migrate/20080808192921_update_sites.rb index abc1234..def5678 100644 --- a/db/migrate/20080808192921_update_sites.rb +++ b/db/migrate/20080808192921_update_sites.rb @@ -0,0 +1,19 @@+class UpdateSites < ActiveRecord::Migration + def self.up + change_table :sites do |t| + t.string :secondary_host, :limit => 255 + t.integer :max_admins, :max_people, :max_groups + t.boolean :import_export, :cms, :pictures, :publications, :default => true + t.boolean :active, :default => true + end + end + + def self.down + change_table :sites do |t| + t.remove :secondary_host + t.remove :max_admins, :max_people, :max_groups + t.remove :import_export, :cms, :pictures, :publications + t.remove :active + end + end +end
Add features to sites table.
diff --git a/spec/factories/kalibro_configurations.rb b/spec/factories/kalibro_configurations.rb index abc1234..def5678 100644 --- a/spec/factories/kalibro_configurations.rb +++ b/spec/factories/kalibro_configurations.rb @@ -15,5 +15,10 @@ name "Perl" description "Code metrics for Perl." end + + factory :public_kalibro_configuration do + name "Public Kalibro Configuration" + description "Public Configuration." + end end end
Revert "Remove unused factory for KalibroConfiguration" This reverts commit 391258e0397d492831cc76cf481f12e90bdbb634. Signed off by: Heitor Reis <marcheing@gmail.com>
diff --git a/spec/github_cli/commands/merging_spec.rb b/spec/github_cli/commands/merging_spec.rb index abc1234..def5678 100644 --- a/spec/github_cli/commands/merging_spec.rb +++ b/spec/github_cli/commands/merging_spec.rb @@ -0,0 +1,17 @@+# encoding: utf-8 + +require 'spec_helper' + +describe GithubCLI::Commands::Merging do + let(:format) { 'table' } + let(:user) { 'peter-murach' } + let(:repo) { 'github_cli' } + let(:id) { 1 } + let(:api_class) { GithubCLI::Merging } + + it "invokes merge:perform" do + api_class.should_receive(:merge).with(user, repo, {'base'=>'master', 'head'=>'feature'}, format) + subject.invoke "merge:perform", [user, repo], :base => 'master', :head => 'feature' + end + +end
Add specs for merge command.