This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'simplecov' | |
require 'simplecov-console' | |
require 'capybara' | |
require "minitest/reporters" | |
require 'webmock/minitest' | |
class Minitest::Reporters::SpecReporter | |
def record_print_status(test) | |
print_colored_status(test) | |
print(" (%.2fs)" % test.time) unless test.time.nil? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'simplecov' | |
require 'simplecov-console' | |
require 'capybara' | |
require "minitest/reporters" | |
require 'webmock/minitest' | |
class Minitest::Reporters::SpecReporter | |
def record_print_status(test) | |
print_colored_status(test) | |
print(" (%.2fs)" % test.time) unless test.time.nil? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Callable < Module | |
def self.[](method) | |
new(method) | |
end | |
def initialize(method) | |
@method = method | |
end | |
def included(base) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This gist was used to create have_rendered_page_component matcher, because our intention was to | |
# assure that a specific page_component was being rendered. | |
# This is overriding the instrumentation of ViewComponent | |
# to include the parameters that a component might receive when rendering. | |
# frozen_string_literal: true | |
require "active_support/notifications" | |
require "active_support/concern" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This is the helper method used to create the button to add multiple records | |
def link_to_add_new_record(name, f, association, **html_options) | |
new_object = f.object.send(association).klass.new | |
id = new_object.object_id | |
fields = f.fields_for(association, new_object, child_index: id) do |builder| | |
render(association.to_s.singularize, builder: builder) | |
end | |
link_to(name, '#', class: html_options[:class], id: "add-new-record", data: {id: id, fields: fields.gsub("\n", "")}) | |
end |